You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Walter B. Rasmann" <wa...@googlemail.com> on 2009/04/16 19:28:12 UTC
Maven does not update snapshot dependency to latest version
Maven doesn't update snapshot dependencies to the latest version when run as:
mvn clean
mvn -U assemby:assembly
The "-with-dependencies" jar contains the old versions of the class
files and the local repository looks like this:
(~/.m2/repository/com/xxx/dependency1/dependency1/1.0-SNAPSHOT)
dependency1-1.0-<TIMESTAMP>-1.jar
dependency1-1.0-<TIMESTAMP>-2.jar
dependency1-1.0-<TIMESTAMP>-3.jar
dependency1-1.0-<TIMESTAMP>-4.jar
dependency1-1.0-<TIMESTAMP>-5.jar
dependency1-1.0-<TIMESTAMP>-6.jar
dependency1-1.0-SNAPSHOT.jar
where "dependency1-1.0-SNAPSHOT.jar" is identical to
"dependency1-1.0-<TIMESTAMP>-1.jar". But
"dependency1-1.0-<TIMESTAMP>-6.jar" is the most recent package by
timestamp and package content.
The packages used as dependencies have been installed to a local
archiva repository using:
mvn deploy:deploy-file -DgroupId=com.xxx.dependecy1
-DartifactId=dependency1 -Dversion=1.0-SNAPSHOT -Dpackaging=jar
-Dfile=dependency1.jar -Durl=[url] -DrepositoryId=[id]
and are referenced in the "main" project pom as:
<dependency>
<groupId>com.xxx.dependency1</groupId>
<artifactId>dependency1</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
When run as
mvn -U -X assembly:assembly
maven produces the following output:
[INFO] snapshot com.xxx.dependency1:dependency1:1.0-SNAPSHOT: checking
for updates from <archiva repository id>
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: '<archiva repository id>' with url:
'<archiva repository url>'.
[INFO] snapshot com.xxx.dependency1:dependency1:1.0-SNAPSHOT: checking
for updates from repo1
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: 'repo1' with url:
'http://repo1.maven.org/maven2/'.
[DEBUG] repository metadata for: 'snapshot
com.xxx.dependency1:dependency1:1.0-SNAPSHOT' could not be found on
repository: repo1
[INFO] snapshot com.xxx.dependency1:dependency1:1.0-SNAPSHOT: checking
for updates from maven2-repository.dev.java.net
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: 'maven2-repository.dev.java.net'
with url: 'http://download.java.net/maven/2/'.
[DEBUG] repository metadata for: 'snapshot
com.xxx.dependency1:dependency1:1.0-SNAPSHOT' could not be found on
repository: maven2-repository.dev.java.net
[DEBUG] Skipping disabled repository central
[DEBUG] dependency1: resolved to version 1.0-<TIMESTAMP>-6 from
repository <archiva repository id>
[DEBUG] com.xxx.dependency1:dependency1:jar:1.0-SNAPSHOT:compile
(selected for compile)
This actually suggests that it found the right version. But
"dependency1-1.0-<TIMESTAMP>-1.jar" gets included into the
"-with-dependencies" jar anyway.
After deleting
~/.m2/repository/com/xxx/dependency1/dependency1/1.0-SNAPSHOT/dependency1-1.0-SNAPSHOT.jar
manually and reruning "mvn -U assembly:assembly"
"dependency1-1.0-SNAPSHOT.jar" is a copy of
"dependency1-1.0-<TIMESTAMP>-6.jar" and the "-with-dependencies" jar
includes the right files.
Is this some kind of bug?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org