我正在使用Ant脚本将工件部署到我的快照/私有存储库,但我得到了一个Forbidden异常,如下所示。看起来用户名和密码是正确的,因为如果我更改它们,我会得到一个不同的错误(未经授权)。我错过了什么?
[exec] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom:
Failed to deploy artifacts: Could not transfer artifact br.com.simpleconsulting.portal:portal-client:jar:6.1.0-20121007.102101-1 from/to cloudbees-snapshot (https://repository-tmoreira2020.forge.cloudbees.com/snapshot):
Access denied to: https://repository-tmoreira2020.forge.cloudbees.com/snapshot/br/com/simpleconsulting/portal/portal-client/6.1.0-SNAPSHOT/portal-client-6.1.0-20121007.102101-1.jar, ReasonPhrase:Forbidden. -> [Help 1]
答案 0 :(得分:5)
CloudBees基础架构上未经授权的错误(403
)的两个常见原因是
我可以看到列出的网址路径存在且包含新工件 - 您在发布此问题后是否正常工作?
答案 1 :(得分:2)
尝试将settings.xml显式传递给maven命令:
mvn -s~ / .m2 / settings.xml deploy
另外,请确保在maven pom.xml的build部分中配置了webdav-jackrabbit扩展
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.2</version>
</extension>
</extensions>