Enhance API to correctly reflect state of the package registry in the maven-metadata.xml file.
Background:
We have been migrating maven artifacts from nexus to package registry.
- It uses the maven dependency:get to retrieve artifacts from nexus.
- It uses the gitlab REST api to publish artifacts to the package registry.
In nexus, we see a maven-metadata.xml (I have omitted the releases between 0.0.4 and 2.0.39 for brevity).
<metadata>
<groupId>redactedGroup</groupId>
<artifactId>redactedProject1</artifactId>
<versioning>
<latest>1.0.7</latest>
<release>2.0.42</release>
<versions>
<version>0.0.1</version>
<version>0.0.3</version>
<version>0.0.4</version>
...
<version>2.0.39</version>
<version>2.0.40</version>
<version>2.0.41</version>
<version>2.0.42</version>
</versions>
<lastUpdated>20210909140329</lastUpdated>
</versioning>
</metadata>
And of course, nexus contains these artifacts as well.
After migrating a number of artifacts from nexus to the package registry, we attempt to look at maven-metadata.xml via this url
https://redacted/packages/maven/redactedGroup/redactedProject1/maven-metadata.xml and we get a 404, file not found.
We can contrast that with a project where we have published artifacts to the gitlab package registry using maven’s release plugin. If we use a similar url:
https://redacted/packages/maven/redactedGroup/redactedProject2/maven-metadata.xml
<metadata>
<groupId>redactedGroup</groupId>
<artifactId>redactedProject2</artifactId>
<versioning>
<release>1.0.41</release>
<versions>
<version>1.0.24</version>
<version>1.0.25</version>
<version>1.0.26</version>
<version>1.0.28</version>
<version>1.0.29</version>
<version>1.0.30</version>
<version>1.0.36</version>
<version>1.0.37</version>
<version>1.0.38</version>
<version>1.0.39</version>
<version>1.0.40</version>
<version>1.0.41-SNAPSHOT</version>
<version>1.0.41</version>
<version>1.0.42-SNAPSHOT</version>
</versions>
<lastUpdated>20211005154204</lastUpdated>
</versioning>
</metadata>
Desired Outcome:
- We would like the artifacts which are published to the package registry via the web api to accurately be reflected in the maven-metadata.xml files.
- Or does gitlab have a url to rebuild maven-metadata.xml?
- It appears that the maven-metadata.xml is rebuilt when a package is removed. See #11424 (closed). Could this functionality be triggered by an REST api call?