0
我在將工件部署到Artifactory時遇到問題。下面的命令在Windows上運行良好:Maven Deploy - 在Windows上工作,在Bamboo上失敗(Unix)
mvn clean deploy -s settings.xml -Dinternal.repo.username=user -Dinternal.repo.password=myEncryptedPassword -X
密碼被加密。
而且我必須建立在竹計劃和任務與此相同的命令,它失敗,下面的輸出:
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>
...
竹在Unix上運行。這個問題是否來自通過命令行傳遞的錯誤參數?
@Edit
我發現有通過CMD覆蓋settings.xml文件有問題。 Artifactory日誌顯示不同的用戶(來自M2_HOME/settings.xml)試圖部署工件,但他沒有要求權限。
[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