Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.20.1
Description
Running cleanup against a snapshot repo that contains non-timestamped snapshots results in the removal of the maven-metadata.xml files under the given snapshot GAV.
To reproduce:
1. Directly upload e.g. via curl artifacts (pom, metadata, jar) to a non-timestamped GAV in a snapshot repo e.g. com/foo/bar/1.0.0-SNAPSHOT.
2. Set org.sonatype.nexus.repository.maven.internal to TRACE logging.
3. Configure and assign a cleanup policy to this repo (specific policy criteria is not applicable to test).
4. Run cleanup services task.
The following will be logged confirming the metadata is removed from under the GAV:
2020-02-10 15:28:55,513+0000 DEBUG [quartz-3-thread-20] *SYSTEM org.sonatype.nexus.repository.maven.internal.hosted.metadata.MetadataBuilder - <- GAbV: com.foo:bar:1.0.0-SNAPSHOT
{{ 2020-02-10 15:28:55,513+0000 DEBUG [quartz-3-thread-20] SYSTEM *org.sonatype.nexus.repository.maven.internal.hosted.metadata.MetadataBuilder - Not a snapshot or nothing to generate: com.foo:bar:1.0.0-SNAPSHOT}}
{{ 2020-02-10 15:28:55,513+0000 TRACE [quartz-3-thread-20] *SYSTEM org.sonatype.nexus.repository.maven.internal.MavenFacetImpl - DELETE maven-snapshots : com/foo/bar/1.0.0-SNAPSHOT/maven-metadata.xml}}
{{ 2020-02-10 15:28:55,514+0000 TRACE [quartz-3-thread-20] *SYSTEM org.sonatype.nexus.repository.maven.internal.MavenFacetImpl - DELETE maven-snapshots : com/foo/bar/1.0.0-SNAPSHOT/maven-metadata.xml.sha1}}
{{ 2020-02-10 15:28:55,515+0000 TRACE [quartz-3-thread-20] *SYSTEM org.sonatype.nexus.repository.maven.internal.MavenFacetImpl - DELETE maven-snapshots : com/foo/bar/1.0.0-SNAPSHOT/maven-metadata.xml.md5}}
Expected behaviour is for metadata under non-timestamped GAV to not be removed or for it to be rebuilt.