简体   繁体   中英

How to make incremental builds of maven project

every time I build my maven project, I get something like this: xxx-0.0.1-SNAPSHOT.jar . I'd like to have something like xxx-0.0.2-SNAPSHOT.jar , xxx-0.0.3-SNAPSHOT.jar etc, however a .jar that increments its name. I think, it can be done adding some plugin in pom.xml , but not yet figured out exactly how.

How can I do?

Thank you.

Snapshot builds are meant to be volatile, ie you can build 0.0.1-SNAPSHOT as often as you like and when you reference 0.0.1-SNAPSHOT , you get the newest version.

If you need versions with fixed numbers (like 0.0.1 ), you build releases . This can eg be done by using the Maven release plugin. If you apply it to your version 0.0.1-SNAPSHOT , then it builds 0.0.1 and makes a new commit to your git/svn to change the version number to 0.0.2-SNAPSHOT .

Before you decide what to do you should analyse exactly what you want to achieve with your versioning scheme.

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