I just deployed a Maven multi module project to Nexus with a SNAPSHOT version.
The deployed artifacts are present in the Nexus snapshot repository and I can download them directly through the Nexus interface.
However, when I add those artifacts as dependencies to another project, Maven is not able to resolve them.
I get the following error:
Downloading: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/maven-metadata.xml
Downloaded: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/maven-metadata.xml (835 B at 15.1 KB/sec)
Downloading: http://<nexus-url>/nexus/content/groups/public/<groupId>/<artifactId>/1.0-SNAPSHOT/<artifactId>-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.056s
[INFO] Finished at: Tue Mar 25 17:49:23 IST 2014
[INFO] Final Memory: 11M/234M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-project: Co
uld not resolve dependencies for project com.example:my-project:jar:2.0-SNAPSHOT: Could not find artifact <groupId>:<artifactId>:jar:1.0-SNAPSHOT in nexus (http://<nexus-url>/nexus/content/groups/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
Note that Maven doesn't try to download the file maven-metadata.xml
.
Thanks, Mickael
EDIT: Maven DOES download the file maven-metadata.xml
. Using -U
doesn't help.
It seems that Maven tries to download the artifact without translating SNAPSHOT to an appropriate to timestamp.