Search code examples
javamavennexus

How to tell maven to use a snapshot version? It tries to load x.y.z-SNAPSHOT but nexus has replaced -SNAPSHOT


We use a nexus repository for our libraries. Another projects has it as a dependency in version 6.1.2-SNAPSHOT, but maven fails to fetch it.

It tries to fetch https://nexus/nexus/repository/snapshots/tld/company/lib/lib-6.1.2-SNAPSHOT.jar but it fails. When checking manually I can see that there is a https://nexus/nexus/repository/snapshots/tld/company/lib/lib-6.1.2-20220101.111111-11.jar available.

My settings.xml has a repository entry for the snapshots:

<repository>
  <id>snapshots</id>
  <url>https://nexus/nexus/repository/snapshots</url>
  <releases><enabled>false</enabled></releases>
  <snapshots><enabled>true</enabled></snapshots>
</repository>

How do I tell Maven to use that instead?


Solution

  • Okay, the issue was resolved.

    We had a "clean snapshots task" in Nexus which deleted "old" -- although this one was not that old -- snapshots. We changed the number of kept snapshots and restored the ones missing.

    Thanks so far for all suggestions!