Reputation: 2366
I have issue during deploying artifact to Artifactory. Command below works well on Windows:
mvn clean deploy -s settings.xml -Dinternal.repo.username=user -Dinternal.repo.password=myEncryptedPassword -X
Password is encrypted.
But also I have build plan on Bamboo and task with this same command, and it fails with following output:
my-artifact: Failed to deploy artifacts: Could not transfer artifact com.foo.my.artifact:1.9from/to artifactory (http://repository.xxx.com/artifactory/snapshots): Access denied to: http://repository.xxx.com/artifactory/snapshots/xxx/xxxx/xxxx.pom, ReasonPhrase: Forbidden.
settings.xml
...
<servers>
<server>
<id>artifactory</id>
<username>${internal.repo.username}</username>
<password>${internal.repo.password}</password>
</server>
</servers>
...
Bamboo runs on Unix. Can this problem comes from wrong argument passing via command line etc. ?
@Edit
I discovered there is a problem with overriding settings.xml file via cmd. Artifactory logs show diffrent user (from M2_HOME/settings.xml) is trying to deploy artifact but he dosen't has required permissions.
[DEBUG] Reading global settings from /app/maven/3.3.9/conf/settings.xml
12-Oct-2017 11:19:48
[DEBUG] Reading user settings from /app/maven/3.3.9/../apache-maven-settings.xml
12-Oct-2017 11:19:48
[DEBUG] Reading global toolchains from /app/maven/3.3.9/conf/toolchains.xml
12-Oct-2017 11:19:48
[DEBUG] Reading user toolchains from /home/jiradmin/jiradmin/.m2/toolchains.xml
12-Oct-2017 11:19:48
[DEBUG] Using local repository at /app/maven/3.3.9/repo
Upvotes: 0
Views: 342
Reputation: 35795
Your Bamboo does not transfer the right username/password (at least, this is the most plausible explanation). So probably, these credentials are not read correctly from the settings.xml. Either you have different settings.xml files, encoding problems or some other difference in the used settings.xml files.
Upvotes: 2