VSTS Maven 构建失败 - 禁止访问

VSTS Maven Build Failaure - Forbidden

我在 vsts 构建中遇到以下错误。我按照提到的相同步骤 here 但没有运气。

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

[编辑]:添加了 CI 构建日志

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]

请忽略包名,我已经用虚拟名称覆盖了。

在 Micorosoft 支持的帮助下,我终于解决了这个问题。这是解决方案:

在vsts构建定义的Maven任务中,如果我们select选项"Authenticate built-in Maven feeds"那么我们不需要在选项下提供“-s settings.xml”

去掉选项下的“-s settings.xml”后;构建成功完成。