Commit 1a060f7d authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs-maven-repo-cli-credentials' into 'master'

Added example for passing Maven repo credentials

Closes gitlab-ee#6711

See merge request gitlab-org/gitlab-ce!32073
parents 12936a8d c1000b79
...@@ -125,6 +125,21 @@ variables: ...@@ -125,6 +125,21 @@ variables:
Because the template is [evaluated before](../../../ci/yaml/README.md#include) Because the template is [evaluated before](../../../ci/yaml/README.md#include)
the pipeline configuration, the last mention of the variable will take precedence. the pipeline configuration, the last mention of the variable will take precedence.
#### Using a variable to pass username and password to a private Maven repository
If you have a private Apache Maven repository that requires login credentials,
you can use the `MAVEN_CLI_OPTS` [environment variable](#available-variables)
to pass a username and password. You can set it under your project's settings
so that your credentials aren't exposed in `.gitlab-ci.yml`.
If the username is `myuser` and the password is `verysecret` then you would
set the following [variable](../../../ci/variables/README.md#via-the-ui)
under your project's settings:
| Type | Key | Value |
| ---- | --- | ----- |
| Variable | `MAVEN_CLI_OPTS` | `-Drepository.password=verysecret -Drepository.user=myuser` |
### Overriding the SAST template ### Overriding the SAST template
If you want to override the job definition (for example, change properties like If you want to override the job definition (for example, change properties like
......
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