How to differentiate between deploying releases vs snapshots

前端 未结 3 1013
囚心锁ツ
囚心锁ツ 2021-01-30 15:54

I may be missing something extremely obvious, but I need some clarification regardless. I am about to begin development using maven and archiva. I added both servers + settings

3条回答
  •  花落未央
    2021-01-30 16:25

    You can execute mvn deploy.

    If your POM version contains SNAPSHOT as suffix, it will deploy into the repository configured under distributionManagement.snapshotRepository.

    If your POM doesn't contain SNAPSHOT suffix, it will deploy into the repository configured under distributionManagement.repository.

    However, I do recommend you to use maven-release-plugin to manage versioning and deployment. By running mvn -B release:clean release:prepare release:perform, in resume:

    • the suffix SNAPSHOT is removed from the version (e.g. 2.1-SNAPSHOT -> 2.1);
    • the application is built so as to generate JAR files;
    • the code is committed to your code repository (e.g. git) and tagged (e.g. 2.1);
    • the JAR is deployed into your release repository (not snapshot repo);
    • the version is incremented and the suffix SNAPSHOT is added (e.g. 2.2-SNAPSHOT).

提交回复
热议问题