Can I change the timestamp of a snapshot to an assembly number?

Recently, we saw an error when Maven tries to get a SNAPSHOT, which is not there. Since you can see the build number (no matter what it is, because it is not our build number), but the timestamp does not work, which leads to a build failure. This happens every 20 lines.

This is in Nexus: In nexus

And this is what happens during build:

Articats not found

As you can see, he is trying to extract relations-models:jar:1.1-20170901.134955-278which does not exist as well 20170901.134954-278. Pay attention to 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 cannot find a way to influence how the snapshots are suffixed. Does anyone know how to do this?

This refers to a (large) multi-module project, where it is one of the sub-modules.

Jar plugin is configured as follows

<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 deploy the plugin as follows:

<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>

Assembly is carried out in parallel.

+6
source share
1 answer

Maven will try to download the latest snapshot version specified in the file maven-metadata.xmlin the repository.

, , maven-metadata.xml, . - ; , , spanshot, . (, , maven pom.xml)

+1

All Articles