Use server HTTP headers configured in settings.xml

Description

Maven allows configuring specific HTTP headers that are added to outgoing requests.

https://maven.apache.org/guides/mini/guide-http-settings.html#HTTP_Headers

This is sometimes needed for token-based authentication. An example are the Maven repositories provided by Gitlab.

https://docs.gitlab.com/ee/user/packages/maven_repository/#authenticating-with-a-ci-job-token

This is not currently supported. A proposed solution is included as a patch, which is based on the code found here:

https://github.com/ops4j/org.ops4j.pax.url/blob/master/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java#L1174-L1186

Note that the example in the Gitlab docs contradicts the Maven docs and the implementation I linked to, it uses a <property> xml tag where the Maven docs use <httpHeader>. I have stuck with the version from the Maven docs.

Environment

None

Status

Assignee

Unassigned

Reporter

Arne Brasseur

Labels

None

Approval

None

Patch

Code

Priority

Major
Configure