We've been seeing a bug recently where Maven tries to retrieve a SNAPSHOT that doesn't exist. As you can see the build number (whatever that is, because it's not our build number) matches, but the timestamp doesn't, causing the build to fail. This happens once in every say 20 builds.
This is in Nexus:
And this is what happens during the build:
As you can see it tries to retrieve relations-models:jar:1.1-20170901.134955-278
which doesn't exist, while 20170901.134954-278
does. Notice the offset of one second.
This concerns a (big) multi-module project, where this is one of the sub-modules.
The Jar plugin is configured like this
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>me.magnet.redirect.RedirectService</mainClass>
<useUniqueVersions>false</useUniqueVersions>
<classpathLayoutType>custom</classpathLayoutType
<customClasspathLayout>$${artifact.artifactId}-$${artifact.baseVersion}.$${artifact.extension}</customClasspathLayout>
</manifest>
</archive>
</configuration>
</plugin>
And the deploy plugin like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<uniqueVersion>false</uniqueVersion>
<deployAtEnd>true</deployAtEnd>
</configuration>
</plugin>
The build runs in parallel too.
What is SNAPSHOT? SNAPSHOT is a special version that indicates a current development copy. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository for every build.
A Maven snapshot is a special version of a Maven package that refers to the latest production branch code. It is a development version that precedes the final release version. You can identify a snapshot version of a Maven package by the suffix SNAPSHOT that is appended to the package version.
Maven will try to download the latest snapshot version listed in the maven-metadata.xml
file in the repository.
It sounds like you have this version listed in the maven-metadata.xml
but the file is actually not there. This could possibly be due to incomplete uploaded build; if e.g. multiple modules are trying to use exact same spanshot version number, but some of them failed to compile and were not uploaded to the repo. ( also, possibly incorrect maven pom.xml
configuration )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With