Overwrite maven-metadata.xml file
Problem
When the user allows Maven duplicates, each publish to the registry adds
- the
maven-metadata.xml
to the versionless package (package with no version) - the .pom and .jar files to the package with a version.
Versionless packages are not returned by APIs so the .pom and .jar are displayed in the UI but the maven-metadata.xml
is not.
When consuming the package, only the latest maven-metadata.xml
is served. The user cannot access the older maven-metadata.xml
files.
With time, a versionless maven package can accumulate many maven-metadata.xml
files. This consumes object storage space.
Proposal
Overwriting the maven-metadata.xml
with each publish of a duplicate Maven package to the registry would reduce storage space, since the older versions of the file are not accessible anyway. This is consistent with what Artifactory does.
Other considerations
With cleanup policies for packages, the versionless package will be taken into account.
Example, let's say that users want to keep only 10 of the duplicated package files. The versionless package will be cleaned up as any other package.
Still, we know for sure that only the most recent file is used in the operations with $ mvn
or $ gradle
.