Open Charrey opened 1 year ago
When fetching appComponents from a Maven repository that uses HTTP header authentication (such as Gitlab) the header and header value specified in the CUBA project's build.gradle are ignored.
Take the following cuba project: minimalexample.zip
Open a request bin on localhost port 1234 or change the secondary repository to a remote requestbin. Then sync the gradle project / run gradle build.
A header is included with the name authorization-header and value very-secret-authorization-token
authorization-header
very-secret-authorization-token
No such header is included
In CubaPlugin.groovy replace the following code:
CubaPlugin.groovy
172 maven { 173 url mavenRepo.url 174 credentials(HttpHeaderCredentials) { 175 name(httpHeaderCredentials.name ?: '') 176 value(httpHeaderCredentials.value ?: '') 177 } 178 }
by this code:
maven { url mavenRepo.url credentials(HttpHeaderCredentials) { name(httpHeaderCredentials.name ?: '') value(httpHeaderCredentials.value ?: '') } authentication { header(HttpHeaderAuthentication) } }
Environment
Description of the bug or enhancement
When fetching appComponents from a Maven repository that uses HTTP header authentication (such as Gitlab) the header and header value specified in the CUBA project's build.gradle are ignored.
Minimal reproducible example
Take the following cuba project: minimalexample.zip
Open a request bin on localhost port 1234 or change the secondary repository to a remote requestbin. Then sync the gradle project / run gradle build.
Expected behavior
A header is included with the name
authorization-header
and valuevery-secret-authorization-token
Actual behavior
No such header is included
Fix
In
CubaPlugin.groovy
replace the following code:by this code: