问题
I am getting below error in vsts build. I followed same steps as mentioned here but no luck.
2017-10-12T15:20:56.2694625Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project mycompany-vault-client: Failed to deploy artifacts: Could not transfer artifact mycompany-vault:mycompany-vault-client:jar:0.0.1-20171012.152055-6 from/to mycompany-dts-visualstudio.com-mycompany.vault.packages (https://mycompany-dts.pkgs.visualstudio.com/_packaging/mycompany.Vault.Packages/maven/v1): Access denied to: https://mycompany-dts.pkgs.visualstudio.com/_packaging/mycompany.Vault.Packages/maven/v1/mycompany-vault/mycompany-vault-client/0.0.1-SNAPSHOT/mycompany-vault-client-0.0.1-20171012.152055-6.jar, ReasonPhrase: Forbidden. -> [Help 1]2017-10-12T15:20:56.2694625Z [ERROR] 2017-1
[Edit]: Added CI Build logs
2017-10-12T15:20:55.0965492Z
2017-10-12T15:20:55.0965492Z Downloaded: https://indus-dts.pkgs.visualstudio.com/_packaging/indus.dtsvault.Packages/maven/v1/indus-dtsvault/indus-dtsvault-client/0.0.1-SNAPSHOT/maven-metadata.xml (747 B at 0.5 KB/sec)
2017-10-12T15:20:55.1121367Z Uploading: https://indus-dts.pkgs.visualstudio.com/_packaging/indus.dtsvault.Packages/maven/v1/indus-dtsvault/indus-dtsvault-client/0.0.1-SNAPSHOT/indus-dtsvault-client-0.0.1-20171012.152055-6.jar
2017-10-12T15:20:55.1278022Z 2/32 KB
2017-10-12T15:20:55.4882462Z 32/32 KB
2017-10-12T15:20:55.4882462Z
2017-10-12T15:20:55.4882462Z Uploading: https://indus-dts.pkgs.visualstudio.com/_packaging/indus.dtsvault.Packages/maven/v1/indus-dtsvault/indus-dtsvault-client/0.0.1-SNAPSHOT/indus-dtsvault-client-0.0.1-20171012.152055-6.pom
2017-10-12T15:20:55.8163616Z 2/3 KB
2017-10-12T15:20:56.1913370Z 3/3 KB
2017-10-12T15:20:56.1913370Z
2017-10-12T15:20:56.1913370Z [INFO] ------------------------------------------------------------------------
2017-10-12T15:20:56.1913370Z [INFO] BUILD FAILURE
2017-10-12T15:20:56.1913370Z [INFO] ------------------------------------------------------------------------
2017-10-12T15:20:56.1913370Z [INFO] Total time: 5.108 s
2017-10-12T15:20:56.2069573Z [INFO] Finished at: 2017-10-12T16:20:56+01:00
2017-10-12T15:20:56.2694625Z [INFO] Final Memory: 10M/193M
2017-10-12T15:20:56.2694625Z [INFO] ------------------------------------------------------------------------
2017-10-12T15:20:56.2694625Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project indus-dtsvault-client: Failed to deploy artifacts: Could not transfer artifact indus-dtsvault:indus-dtsvault-client:jar:0.0.1-20171012.152055-6 from/to indus-dts-visualstudio.com-indus.dtsvault.packages (https://indus-dts.pkgs.visualstudio.com/_packaging/indus.dtsvault.Packages/maven/v1): Access denied to: https://indus-dts.pkgs.visualstudio.com/_packaging/indus.dtsvault.Packages/maven/v1/indus-dtsvault/indus-dtsvault-client/0.0.1-SNAPSHOT/indus-dtsvault-client-0.0.1-20171012.152055-6.jar, ReasonPhrase: Forbidden. -> [Help 1]
Pls ignore package name, I have override with dummy name.
回答1:
Finally I was able to fix this issue with the help of Micorosoft support. Here is the solution :
In Maven task of vsts build definition, if we select the option "Authenticate built-in Maven feeds" then we do not need to provide"-s settings.xml" under Options
After removing "-s settings.xml" under options; build completed successfully.
来源:https://stackoverflow.com/questions/46714591/vsts-maven-build-failaure-forbidden