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.
- Does anyone else have this problem? And a workaround?
- I was thinking of replacing the timestamp with the build number, but I can't find a way to influence how snapshots are suffixed. Does anyone know how to do that?
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.
maven-matedata.xml
has the wrong artifact name. So my hunch is that because of the parallel build, and thedeployAtEnd
config, it takes a new timestamp instead of using the one it already communicated to themaven-matedata.xml