How do I prevent/delete old packages in gitlab maven repository

I have a java project built with gradle, that publishes to a GitLab maven repository. The gitlab maven documentation claims the following:

When you publish a package with the same name or version as an existing package, 
the existing package is overwritten.

But this does not happen. The repository is filling up with old versions of the same package. How can I prevent this from happening and/or delete the old package versions in the repository?

1 Like