Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.8.4
-
None
-
None
Description
Given that I have two metadata on version level:
<metadata modelVersion="1.1.0">
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>org.apache.jackrabbit.vault</artifactId>
<version>3.5.9-SNAPSHOT</version>
<versioning>
...
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>3.5.9-1</value>
<updated>20220218143327</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
and
<metadata modelVersion="1.1.0">
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>org.apache.jackrabbit.vault</artifactId>
<version>3.5.9-SNAPSHOT</version>
<versioning>
...
<snapshotVersions>
<snapshotVersion>
<extension>jar</extension>
<value>3.5.9-2</value>
<updated>20220220143327</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>
</metadata>
Merging both via https://github.com/apache/maven/blob/03df5f7c639db744a3597c7175c92c8e2a27767b/maven-repository-metadata/src/main/mdo/metadata.mdo#L91 does not lead to two different snapshotVersions but only the one from the original metadata.
On the other hand the merge in https://github.com/apache/maven/blob/03df5f7c639db744a3597c7175c92c8e2a27767b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RemoteSnapshotMetadata.java#L72 does seem to do the merging correctly.
As IMHO the logic of merging should be agnostic of the resolver provider, those versions should always be merged using all three fields from https://github.com/apache/maven/blob/03df5f7c639db744a3597c7175c92c8e2a27767b/maven-repository-metadata/src/main/mdo/metadata.mdo#L315-L333 concatenated as ID.