Why the snapshot name always has date in its jar file name ? How to remove it

孤街浪徒 提交于 2020-01-01 04:37:08

问题


When I deploy jar, maven always add date in its file name, this make the file name repository different from the file in my local. How can I remove the date in file name ?

Thanks


回答1:


About why, it's because being it a SNAPSHOT package, each time you deploy it you are de-facto deploying a new version of it, so the timestamp is added to differentiate them in the remote repository. When Maven downloads it, it removes the timestamp because on your local repository there can only be one version, so the timestamp is useless if not confusing.

It can be removed, this site use the -DuniqueVersion=false parameter :

mvn deploy:deploy-file -Durl=file:///C:/m2-repo \
                   -DrepositoryId=some.id \
                   -Dfile=your-artifact-1.0.jar \
                   -DpomFile=your-pom.xml \
                   -DuniqueVersion=false

However, you should NOT care about artifact names, files etc.. You are using maven SO THAT you don't have to care about them.



来源:https://stackoverflow.com/questions/6920536/why-the-snapshot-name-always-has-date-in-its-jar-file-name-how-to-remove-it

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