Nexus configuration tips
Use case: Open repositories and secured repositories in the same Nexus installation.
See also https://support.sonatype.com/entries/24901127-Sonatype-Nexus-Security-Cookbook.
- Set up anonymous user
- Remove access for the anonymous user to all repositories.
- Create privileges for releases and snapshots repositories.
- Create a new role with view and read access to releases and snapshots repositories.
- Assign this role to the anonymous user
- Set up repositories for a secret project
- Create two new repositories (proj-releases and proj-snapshots)
- Create privileges for both repositories.
- Create a new role (read-only) with view and read access to both repositories.
- Create a new role (deployment) full access to both repositores (todo add exactly which privileges are necessary for deployment)
- Copy distributionManagement section from the repository summary page in the Nexus web console and add to the project pom.xml.
- Url example: http://mvnrepo.company.no/index.html#view-repositories;releases~summary
- Add credentials to settings.xml or Jenkins credentials support which reference the repository id in pom.xml.
- It is possible to use the same id for both snapshots and releases repo in pom.xml to have only a single entry in settings.xml if the user is given deployment privileges to both repos.
Scheduled tasks run nightly
-
Remove snapshots from repository
-
Rebuild Maven metadata
-
Repair Repositories Index
Docs: http://books.sonatype.com/nexus-book/reference/scheduled-tasks.html