简体   繁体   中英

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:

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. I want to know, is there a way to specify the maven versioning? for example the ant-contrib:ant-contrib:1.0b2 artifact is for snapshot.

Not sure how are you are managing the project.version in pom.xml. It should end with SNAPSHOT for snapshots mvn deploy command should deploy to snapshot.

If your project.version in pom.xml SNAPSHOT as suffix --> deploy to snapshotRepository.

If project.version does not have SNAPSHOT as suffix in pom.xml --> deploy to release repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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