Search code examples
downloadmaven-3snapshot

Maven Not Downloading/Recognizing Snapshot


We use Maven/Nexus/Hudson in our team. The Maven version on our Hudson server is 3.0.4 and has stopped being able to download snapshot dependencies when building jobs. I'm not sure what has changed (no on the team has done anything, so they say), but something has happened because builds that worked Monday morning stopped working Monday afternoon.

When I try to build a project in Hudson that has a snapshot dependency, I get this error:

[WARNING] The POM for com.company:my-client:jar:1.9-SNAPSHOT is missing, no dependency information available

I believe I have nailed the issue down to the fact that Maven isn't downloading the maven-metadata.xml file and therefore can't resolve the dependency to the timestamp version. For example, in my local build (using Maven 3.0.3), I see this in my Maven output:

Downloading: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/maven-metadata.xml
Downloaded: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/maven-metadata.xml (1004 B at 20.0 KB/sec)
Downloading: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/my-client-1.9-20130625.202822-1.pom
Downloaded: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/my-client-1.9-20130625.202822-1.pom (3 KB at 57.5 KB/sec)
...
Downloading: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/my-client-1.9-20130625.202822-1.jar
...
Downloaded: http://ip:8080/nexus/content/groups/public/com/company/my-client/1.9-SNAPSHOT/my-client-1.9-20130625.202822-1.jar (10 KB at 153.9 KB/sec)

Both builds are accessing our Nexus repo and the Hudson Maven has no problems accessing non-snapshot dependencies from it, so it's not a connection issue.

Why would Maven not recognize the SNAPSHOT and download the maven-metadata.xml to get the latest timestamp version of the dependency?


Solution

  • After much hair-pulling, we discovered that our settings.xml file for the hudson user had the nexus profile removed. This appears to have the effect of not being able to query the snapshot repo although it could get artifacts from the release repo.

    The last edit of the file before we fixed it was May 29th so it's still a mystery as to why the jobs built in the morning of June 24th but not in the afternoon. Perhaps something was being cached and that was refreshed.