mvn deploy:file to different repositories for snapshot and release version

╄→гoц情女王★ 提交于 2019-12-03 22:23:46
khmarbaise

If you defined your repositories within your settings.xml you can use the

mvn deploy:deploy-file -DrepositoryId=releases -DartifactId=... -Durl=
Urs Reupke

Over here, I used the GMaven plugin to choose the repository from the distributionManagement section of the POM and store it in a property.

The deploy plugin can then use that property.

keiki

Maybe you want to use the build-helper-maven-plugin to deploy an additional artifact

This is presumably the Maven way:

  <distributionManagement>
    <repository>
      <id>release</id>
      <url>http://my-releases</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>http://my-snapshots</url>
    </snapshotRepository>
  </distributionManagement>

When doing a deploy of a snapshot version, it'll go the snapshots repository. For a non-snapshot release the regular repository will be used.

Just run deploy and it'll work. :-)

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