I am using GOCD Docker agents and have created my own docker agent image based on gocd/gocd-agent-centos-7:v17.11.0, and have added Java SDK & Maven, and a custom maven settings.xml
I have a artifact repository that i must authenticate with so in my settings.xml i have added the following section.
<server>
<id>my-artifact-repo-name</id>
<username>${GO_REPO_USER}</username>
<password>${GO_REPO_PASSWORD}</password>
</server>
From my GOCD pipeline i have added environment variables for GO_REPO_USER and GO_REPO_PASSWORD.
The GO_REPO_USER is always injected as expected but GOCD seems to think the password is encrypted and is always looking for a settings-security.xml.
I see the following error on the console
[DEBUG] Failed to decrypt password for server my-artifact-repo-name: org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: java.io.FileNotFoundException: /home/go/.m2/settings-security.xml (No such file or directory)
org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException: java.io.FileNotFoundException: /home/go/.m2/settings-security.xml (No such file or directory)
If i update the settings.xml with <password>my-password</password> instead of the password i entered as environment variable then it will authenticate fine.
Any help appreciated