You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gebhardt, Jörn <Jo...@comsoft.aero> on 2011/02/21 13:33:37 UTC

Maven 3.0.2 SNAPSHOT update bug?

Hi all,

I discovered some strange behavior regarding the SNAPSHOT versions and the local repository update strategy in Maven 3.0.2 (on a Linux system):

If I have a project named "projectA" with version 1.0-SNAPSHOT and I call "mvn install" it copies the built artifact and the POM of projectA into the local repository as expected. However, the last modified date of the projectA-1.0-SNAPSHOT.pom file does not reflect the build or upload time but the real last modified date of the POM as it is set in the workspace (i.e. if the POM was last modified 5 days ago the file date of the POM in the local repository is also 5 days old)

If I now build a project "projectB" that depends on the Snapshot version of  project "projectA ", Maven looks into the central repository and overrides my just built and installed version with an older one from the central repository. My guess is that this happened because it compares the meta-information of the central repository with the "last modified" file system attribute of the projectA -1.0-SNAPSHOT.pom file.

Is this an already known bug?
If it is a bug, does there exist any workaround (e.g. tell the install plugin to change the "last modified" attribute of the POM when copying it into the local repository)?

Thanks in advance,
Joern


Re: Maven 3.0.2 SNAPSHOT update bug?

Posted by Benjamin Bentmann <be...@udo.edu>.
Gebhardt, Jörn wrote:

> If I now build a project "projectB" that depends on the Snapshot version of  project "projectA ", Maven looks into the central repository and overrides my just built and installed version with an older one from the central repository. My guess is that this happened because it compares the meta-information of the central repository with the "last modified" file system attribute of the projectA -1.0-SNAPSHOT.pom file.

This guess is wrong, the file's timestamp is not used for snapshot 
updates. Instead. the timestamp recorded in maven-metadata-*.xml files 
is used to determine the latest snapshot.

> Is this an already known bug?
> If it is a bug, does there exist any workaround (e.g. tell the install plugin to change the "last modified" attribute of the POM when copying it into the local repository)?

Maven 3.0.1 has a bug in this regard which is fixed in 3.0.2. So if you 
can provide an example project that demonstrates the problem, please 
fill a bug in the isse tracker so we can take a closer look.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org