deploying maven jar files and SNAPSHOT dependencies

微笑、不失礼 提交于 2019-12-08 05:47:02

问题


We currently use SNAPSHOT modifier in development so that project dependencies are linked to the most current build of its dependencies. So when we build a project we get all the jars with various time SNAPSHOTS. Regardless of a code change.

This proves to be an issue when the end user wants to download a new release. For example there is a big jar file that is rarely updated. We would like for that particular jar file to be referred to as it version number 1.4 as supposed to 1.4-SNAPSHOT when we release it to the customer meaning they only download new version when we make changes to the version number as supposed to when we last built it with or without changes.

What is the best way to achieve this? Am I missing something?

Please and thank you.


回答1:


This proves to be an issue when the end user wants to download a new release.

First of all, releases should indeed use fixed versions. So if you're developing version 1.4-SNAPSHOT, the release version is supposed to be 1.4 (and you tag it as such in your VCS). And then you bump the new development version to 1.5-SNAPSHOT in the dev branch.

For example there is a big jar file that is rarely updated. We would like for that particular jar file to be referred to as it version number 1.4 (...)

But even if you follow the above "standard" process, nothing forces you to bump all versions after a release and you could just stick to a given fixed version of a particular artifact. This would remove the problem.




回答2:


In my opinion a way to a user is a kind of delivery and should be handled by using the maven release process (mvn release) which automatically increments the version numbers. Than you have an exact relationship to your version control and what user has got. SNAPSHOT's should only be used in development.



来源:https://stackoverflow.com/questions/3619628/deploying-maven-jar-files-and-snapshot-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!