![]() ![]() lookup ( ".maintenance.MaintenanceService" ) def repo = repository. Loggerĭef retentionDays = 30 def retentionCount = 50 def repositoryName = 'maven-releases' def targetlist =. I also want to make sure I always have at least 50 artifacts. I want to delete all artifacts under these components, which are older than 30 days. In the below script (you need it here), I’m deleting two components named au.com.43.shipping and au.com.42.rates, which are both under maven-release. The script screen is self-explanatory.Hit Create Task and choose Admin - Execute Script.Login to nexus as an admin user and go to settings.Nexus allows you to define custom clean up policies via Tasks. Not ideal!!! Groovy script to your rescue ![]() This means I have to set the cleanup policy for the whole repository to retain all artifacts as old as the least released component. In my current workplace, we have a few components which have not been released for over a year. This will be problematic if you have different release frequencies for each component. ![]() For example, the cleanup policies do not allow you to set policy per component but per repository. The cleanup policies lack a few proverbial teeth. !(/media/Nexus Repository Manager_2.png) The Shortcoming
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |