简体   繁体   English

如何检测Maven工件的发布/快照版本控制?

[英]How to detect release/snapshot versioning of maven artifact?

I want to deploy bunch of maven artifacts( war , jar , pom ) to a remote repository( artifactory ) and using maven command: 我想将一堆Maven工件( warjarpom )部署到远程存储库( artifactory )并使用maven命令:

mvn deploy:deploy-file -DgroupId=<group-id> \
  -DartifactId=<artifact-id> \
  -Dversion=<version> \
  -Dpackaging=<type-of-packaging> \
  -Dfile=<path-to-file> \
  -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
  -Durl=<url-of-the-repository-to-deploy>

we have to specify which repository(either release or snapshot ) and url should be use. 我们必须指定应该使用哪个存储库( releasesnapshot )和url。 I want to know, is there a way to specify the maven versioning? 我想知道,有没有一种方法可以指定Maven版本? for example the ant-contrib:ant-contrib:1.0b2 artifact is for snapshot. 例如, ant-contrib:ant-contrib:1.0b2构件用于快照。

Not sure how are you are managing the project.version in pom.xml. 不知道如何在pom.xml中管理project.version。 It should end with SNAPSHOT for snapshots mvn deploy command should deploy to snapshot. 它应以SNAPSHOT结尾以进行快照mvn deploy命令应部署到快照。

If your project.version in pom.xml SNAPSHOT as suffix --> deploy to snapshotRepository. 如果您的pom.xml SNAPSHOT中的project.version为后缀->部署到snapshotRepository。

If project.version does not have SNAPSHOT as suffix in pom.xml --> deploy to release repository. 如果project.version在pom.xml中没有SNAPSHOT作为后缀->部署以发布存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM