In a maven hosted repository, perform the following steps
- Upload multiple base versions of a component under the same GA. For example if this is a snapshot repo, the resulting Browse view could look like:
- Observe that the file at com/example/project1/maven-metadata.xml contains reference to both base versions.
- In the browse UI, select one of the GAV nodes. For example select com/example/project1/1.0.0-SNAPSHOT. On the right hand sidebar there is a button to "Delete folder". Click the button.
- Wait a few seconds to account for any eventual consistency
- Download the GA level maven-metadata.xml again, notice that it is still referencing the deleted baseVersion 1.0.0-SNAPSHOT.
- The GA metadata remains incorrect ( referencing a non-existent base version ) until it is marked for rebuild using some other method, or rebuilt explicitly using the Maven - Rebuild metadata task.
Deleting a baseVersion using Delete folder button should cause the GA level maven-metadata.xml to be accurate on the next download of it, without performing a manual rebuild of the metadata.
To successfully delete an entire GAbaseVersion node manually, select and use "Delete component" button for each timestamped version under the GAbaseVersion folder. After all GAbaseVersion/timestampedVersion versions are deleted, then the maven metadata will be accurate.
Another method is to use the cleanup policies and tasks to delete old GAVs no longer needed. When these tasks are used, then the corrupt metadata also does not happen.
If you trigger the rebuild in another way, e.g. using the "Delete Component" on a GAV timestamped snapshot version, then the rebuild GA maven-metadata.xml will have the correct content.
Another thing that I noticed was that the files differ in some other ways as well. The original file lacks the metadata->modelVersion and metadata->versioning->latest
After Folder Delete
After Component Delete and Folder Delete:
This was reproduced on 68e1b2c4c306a51d53c56e1f3956ab2bb44fe824 before I had merged in my metadata changes.