Commit e83eb49f authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Copyedit Maven docs for CI_JOB_TOKEN support

parent 73cc6c4a
...@@ -28,59 +28,63 @@ repository. ...@@ -28,59 +28,63 @@ repository.
If a project is private or you want to upload Maven artifacts to GitLab, If a project is private or you want to upload Maven artifacts to GitLab,
credentials will need to be provided for authorization. Support is available for credentials will need to be provided for authorization. Support is available for
[personal access tokens](../../profile/personal_access_tokens.md) and [personal access tokens](#authenticating-with-a-personal-access-token) and
[CI job tokens](https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables). [CI job tokens](##authenticating-with-a-ci-job-token).
### Authenticating with a Personal Access Token ### Authenticating with a personal access token
To authenticate with a Personal Access Token, add a corresponding section to your To authenticate with a [personal access token](../../profile/personal_access_tokens.md),
[`settings.xml`](https://maven.apache.org/settings.html) file: add a corresponding section to your
[`settings.xml`](https://maven.apache.org/settings.html) file:
```xml
<settings>
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Private-Token</name>
<value>REPLACE_WITH_YOUR_PERSONAL_ACCESS_TOKEN</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
```
```xml
<settings>
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Private-Token</name>
<value>REPLACE_WITH_YOUR_PERSONAL_ACCESS_TOKEN</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
```
You should now be able to upload Maven artifacts to your project. You should now be able to upload Maven artifacts to your project.
### Authenticating with a CI job token
### Authenticating with a CI Job Token If you're using Maven with GitLab CI/CD, a CI job token can be used instead
of a personal access token.
To authenticate with a CI Job Token, add a corresponding section to your To authenticate with a CI job token, add a corresponding section to your
[`settings.xml`](https://maven.apache.org/settings.html) file: [`settings.xml`](https://maven.apache.org/settings.html) file:
```xml ```xml
<settings> <settings>
<servers> <servers>
<server> <server>
<id>gitlab-maven</id> <id>gitlab-maven</id>
<configuration> <configuration>
<httpHeaders> <httpHeaders>
<property> <property>
<name>Job-Token</name> <name>Job-Token</name>
<value>REPLACE_WITH_YOUR_CI_JOB_TOKEN</value> <value>CI_JOB_TOKEN</value>
</property> </property>
</httpHeaders> </httpHeaders>
</configuration> </configuration>
</server> </server>
</servers> </servers>
</settings> </settings>
``` ```
You should now be able to upload Maven artifacts to your project. You can read more on
[how to create Maven packages using GitLab CI/CD](#creating-maven-packages-with-gitlab-ci-cd).
## Configuring your project to use the GitLab Maven repository URL ## Configuring your project to use the GitLab Maven repository URL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment