Keyword maven -SNAPSHOT not replaced

I have a Maven project with <packaging>jar</packaging>and <version>0.0.11-SNAPSHOT</version>. When I run mvn clean install, it deploys the following in my local repository

~ / .m2 / storage / com / example / MyProject / 0.0.11-SNAPCHOT / stock-0.0.11-SNAPSHOT.jar

I expected the name of the generated artifact to replace -SNAPSHOTwith the timestamp when the JAR was created, something like:

~ / .m2 / storage / com / example / MyProject / 0.0.11-SNAPCHOT / stock-0.0.11-20110217011633.jar

Why does this replacement not occur?

+3
source share
2 answers

I re-read the question, it looks like you are talking about your local machine. I doubt that you can store a unique version in the local repository

: - SNAPSHOT,

.txt . , , .

, 0,15-SNAPSHOT. version.txt, , ( ​​ , ).

,

, , , . - , , , , , .


.

:

SNAPSHOT. AFAIK, Artifactory Nexus .

: http://wiki.jfrog.org/confluence/display/RTF/Local+Repositories

:

  • .
  • - .
  • , Deployer. Artifactory , , - .

Nexus, , , SNAPSHOT. , http://www.sonatype.com/books/nexus-book/reference/config-sect-scheduled-services.html

, uniqueVersion true . , , . ,

 <distributionManagement>
   ...
   <repository>     
     ...
     <uniqueVersion>true</uniqueVersion>
   </repository>
   ...
 </distributionManagement>
+5

, , ( SNAPSHOT), , deploy . install ( , ), - SNAPSHOT .

+4

Source: https://habr.com/ru/post/1792853/


All Articles