{"id":"4fd60b8d-bd3b-4302-9544-66556d890658","task":"Create and apply a cleanup policy in Sonatype Nexus Repository via the REST API to remove Maven artifacts not downloaded in the past 60 days","domain":"help.sonatype.com","steps":["Send a POST request to https://<NEXUS_URL>/service/rest/v1/cleanup-policies with a JSON body containing name, format (maven2), and the criteriaLastDownloaded field set to 60 (days)","Authenticate with an account that holds the nexus:settings:read and nexus:settings:update permissions; use HTTP Basic Auth or a user token","Associate the cleanup policy with one or more hosted repositories by PATCHing the repository configuration at /service/rest/v1/repositories/maven/hosted/<repoName> and adding the cleanup policy name to the cleanup.policyNames array","Trigger the cleanup task manually via POST to /service/rest/v1/tasks/<taskId>/run where the task type is repository.cleanup, or let the scheduled task run on its configured interval","Review the Cleanup Performance Data page in the Nexus UI or query /service/rest/v1/cleanup-policies/<policyName> to confirm artifact counts targeted"],"gotchas":["The cleanup policies REST API endpoint (/service/rest/v1/cleanup-policies) is available in Nexus Repository Pro; the OSS edition may expose a limited subset or require direct database/script approaches","criteriaLastDownloaded counts days since last download for hosted repos but counts days since first upload for proxy repos — this asymmetry is a common source of misconfiguration","Running the cleanup task removes component metadata but does not immediately reclaim disk space; a separate 'Compact blob store' task must be run afterward to free storage"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/4fd60b8d-bd3b-4302-9544-66556d890658"}