Maven: Trying to Deploy with credentials in settings.xml file

淺唱寂寞╮ 提交于 2019-12-02 18:49:17

You need to provide the repositoryId=VeggieCorp (not id) property so that maven knows from which <server> configuration it has to read the credentials.

$ mvn deploy:deploy-file \
 -Durl=http://repo.veggiecorp.com/artifactory/ext-release-local \
 -Dfile=crypto.jar \
 -DpomFile=pom.xml \
 -DrepositoryId=VeggieCorp

See http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html

You can also specify your snapshot repository id in distributionManagement

<distributionManagement>
<repository>
  <id>releases</id>
  <url>${env.MAVEN_RELEASE_REPOSITORY_URL}</url>
</repository>
<snapshotRepository>
  <id>snapshots</id>
  <url>${env.MAVEN_SNAPSHOT_REPOSITORY_URL}</url>
</snapshotRepository>
</distributionManagement>

the ids here should match ones in servers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!