{"id":20757649,"url":"https://github.com/dodevops/nexus-custom-cleanup","last_synced_at":"2026-04-28T05:37:01.489Z","repository":{"id":183388845,"uuid":"670046153","full_name":"dodevops/nexus-custom-cleanup","owner":"dodevops","description":"Custom cleanup solution for Sonatype Nexus Repository Manager","archived":false,"fork":false,"pushed_at":"2025-02-28T06:09:21.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-26T16:52:07.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dodevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-24T07:14:03.000Z","updated_at":"2025-02-28T06:09:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e87f2610-bb3f-474d-9699-324976c195c5","html_url":"https://github.com/dodevops/nexus-custom-cleanup","commit_stats":null,"previous_names":["dodevops/nexus-custom-cleanup"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dodevops/nexus-custom-cleanup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodevops%2Fnexus-custom-cleanup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodevops%2Fnexus-custom-cleanup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodevops%2Fnexus-custom-cleanup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodevops%2Fnexus-custom-cleanup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dodevops","download_url":"https://codeload.github.com/dodevops/nexus-custom-cleanup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodevops%2Fnexus-custom-cleanup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32368533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T09:43:31.188Z","updated_at":"2026-04-28T05:37:01.454Z","avatar_url":"https://github.com/dodevops.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonatype Nexus Repository Manager custom cleanup\n\n## Introduction\n\nSonatype Nexus Repository Manager natively only offers cleanup based on the age of a component or the last download date\nof a component.\n\nWe have the requirement to do a cleanup based on the (maven) path depth and to keep the n youngest components. This tool\nimplements this requirement.\n\n## Usage\n\nThe docker based used is recommended, but if required it can also be used as a node application directly:\n\n### Configuration\n\nThese are the variables to configure the application with:\n\n| Variable             | description                                                                 | Required | Default value |\n|----------------------|-----------------------------------------------------------------------------|----------|---------------|\n| NEXUS_URL            | Nexus base URL without trailing slash                                       | yes      |               |\n| NEXUS_USERNAME       | Nexus user (needs permissions to read and delete components for given repo) | yes      |               |\n| NEXUS_PASSWORD       | Password for that Nexus User                                                | yes      |               |\n| REPO_NAME            | Name of the repo to cleanup components for                                  | yes      |               |\n| KEEP_ITEMS           | Keep this amount of items for given path depth                              | yes      |               |\n| PATH_DEPTH           | Path depth to do cleanup for                                                | yes      |               |\n| EXECUTE_DELETE       | If false, only print components to delete, instead of really deleting them  | no       | \"false\"       |\n| LOG_LEVEL            | Log level for logging                                                       | no       | \"info\"        |\n| KEEP_COMPONENT_PATHS | comma separated list of component path regexps to keep instead of deleting  | no       | []            |\n\n### Docker\n\n#### Build\n\nYou can build the docker image by yourself with typical docker build commands:\n\n    docker build -t nexus-custom-cleanup:latest .\n\nbut it is recommended to use the released docker images from the GitHub registry in this repo.\n\n#### Run\n\nThe container started using this image will terminate, after the cleanup is completed. It does not run as daemon and\ndoes not provide any cron- or interval-like scheduling. Please implement a reoccuring run by yourself, if required.\n\nThe container needs to be run with the configuration (see above) set as environment variables.\n\nAn example execution could be:\n\n    docker run -it --rm -e NEXUS_URL=\"https://nexus.copany.com\" -e NEXUS_USERNAME=\"nexususer\" -e NEXUS_PASSWORD=\"XXXXXXXXX\" -e REPO_NAME=\"application-snapshots-maven-hosted\" -e KEEP_ITEMS=4 -e PATH_DEPTH=7 -e EXECUTE_DELETE=\"false\" nexus-custom-cleanup:latest\n\n### Native node application\n\nFor this it is required that NodeJS is installed on your system already.\n\nInstead of using docker, the solution can be used as a node application directly, be sure to build it first before using\nit:\n\n    npm install\n    npm run build\n\nYou can either set the needed configuration parameters (see above) via environment variables or via an .env file. If you\nuse a .env file, place it in same directory like this README.md\n\nExample call to start the application (it will terminate once the cleanup is completed):\n\n    npm run start\n\n# Development\n\nFor development you need to install typescript and before executing the generated javascript you need to generate it \nbefore your first run and after every change with\n\n    npm run build\n\nin the same directory like this README.md. Typescript code can be found in the src/ directory. Code in dist/ will be overwritten by the code\ngeneration","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodevops%2Fnexus-custom-cleanup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdodevops%2Fnexus-custom-cleanup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodevops%2Fnexus-custom-cleanup/lists"}