Khoda
Khoda

Reputation: 953

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.

Upvotes: 1

Views: 868

Answers (1)

Sheetal Mohan Sharma
Sheetal Mohan Sharma

Reputation: 2924

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.

Upvotes: 2

Related Questions