I have Java projects compiled with maven. Each project has its own POM which looks like the following :
<project ...>
<groupId>group.id</groupId>
<artifactId>scripts</artifactId>
<version>1.0.1-SNAPSHOT</version>
...
<dependencies>
<dependency>
<groupId>global</groupId>
<artifactId>common</artifactId>
<version>10.2.3-SNAPSHOT</version>
</dependency>
</dependencies>
...
</project>
SNAPSHOT as a RELEASE
If I do a mvn install
, it will compile/install it the first time I execute the command.
Next times, it won't install it. It seams that maven consider it as a RELEASE, weither it is a SNAPSHOT.
I can see that in the timestamp included into the installed package. if I don't change the version number, the timestamp does not change either.
I believe I miss a maven configuration but this impacts a lot our development as we're force to change the projects versions (and their dependancies) for every test deployment.
Notes : I'm using maven 3.3.3. It looks like I had not this behavior in 3.1.0 (I'm not 100% sure of the old version. Very old anyway). Maven is coupled with Nexus. Maybe the issue comes from it and I'm focussing on the wrong horse.
Thank you for the hints.
Edit : the question is : How can I get maven installing SNAPSHOTs everytime instead of the first time only like a RELEASE ?
EDIT SOLVED
We've always done mvn install
to compile and install the sources. For some reason, we haven't used the mvn clean
command.
The correct maven command to recompile all the sources is mvn clean install
.
Thank you @VinayVeluri