Repository Management with Nexus
Table of Contents

Repository Management with Nexus

If you are developing software without a repository manager you are likely missing a number of opportunities to reduce some pretty obvious ineffeciencies. If everyone on your team has to hit Central to download artifacts you are missing out on some simple gains in speed and efficiency. If you don't have a local place to deploy artifacts you are forced to share binary artifacts using half-measures and compromises such as storing binaries in source control. Stop developing in the Dark Ages, read this book, and start using a repository manager. Trust us, once you start using Nexus, you'll wonder how you ever functioned without it.

Authors

Sonatype, Inc. Tim O'Brien Manfred Moser Jason Van Zyl Damian Bradicich John Casey Tamás Cservenák Brian Demers Brian Fox Marvin Froeder Anders Hammar Rich Seddon Juven Xu

1. Introducing Sonatype Nexus
1.1. Introduction
1.2. Nexus Open Source
1.3. Nexus Professional
1.4. Choosing a Nexus Edition
1.5. History of Nexus
2. Repository Management
2.1. Repository Management
2.2. What is a Repository?
2.3. What is a Repository Manager
2.4. Reasons to Use a Repository Manager
2.5. Adopting a Repository Manager
3. Installing and Running Nexus
3.1. Nexus Prerequisites
3.2. Downloading Nexus
3.3. Installing Nexus
3.4. Upgrading Nexus
3.5. Running Nexus
3.6. Post-Install Checklist
3.7. Configuring Nexus as a Service
3.8. Running Nexus Behind a Proxy
3.9. Installing the Nexus WAR
3.10. Installing a Nexus Professional License
3.11. Nexus Directories
3.12. Installing Additional Plugins
4. Configuring Maven to Use Nexus
4.1. Introduction
4.2. Configuring Maven to Use a Single Nexus Group
4.3. Adding Custom Repositories for Missing Dependencies
4.4. Adding a New Repository
4.5. Adding a Repository to a Group
5. Using Nexus
5.1. Introduction
5.2. Browsing Repositories
5.3. Browsing Groups
5.4. Searching for Artifacts
5.5. Uploading Artifacts
5.6. Browsing System Feeds
5.7. System Files
5.8. Changing Your Password
5.9. Filing a Problem Report
6. Configuring Nexus
6.1. Customizing Server Configuration
6.2. Managing Repositories
6.3. Managing Groups
6.4. Managing Routes
6.5. Managing Scheduled Tasks
6.6. Managing Security
6.7. Managing Privileges
6.8. Managing Repository Targets
6.9. Managing Roles
6.10. Managing Users
6.11. Network Configuration
6.12. Nexus Logging Configuration
6.13. Nexus Plugins and REST Interfaces
7. Nexus Smart Proxy
7.1. Introduction
7.2. Enabling Smart Proxy Publishing
7.3. Establishing Trust
7.4. Repository Specific Smart Proxy Configuration
7.5. Smart Proxy Security and Messages
7.6. Example Setup
8. Nexus LDAP Integration
8.1. Introduction
8.2. Enabling the LDAP Authentication Realm
8.3. Configuring Nexus LDAP Integration
8.4. Connection and Authentication
8.5. User and Group Mapping
8.6. Mapping Users and Groups with Active Directory
8.7. Mapping Users and Groups with posixAccount
8.8. Mapping Roles to LDAP Users
8.9. Mapping Nexus Roles for External Users
8.10. Mapping External Roles to Nexus Roles
8.11. Enterprise LDAP Support
9. Nexus Procurement Suite
9.1. Introduction
9.2. The Stages of Procurement
9.3. Two Approaches to Procurement
9.4. Accessing Artifact Procurement
9.5. Setting up a Procured Repository
9.6. Configuring a Procurement Rule
9.7. Managing Procurement Rules
9.8. Stopping Procurement
10. Build Promotion with the Nexus Staging Suite
10.1. Introduction
10.2. Using the Nexus Staging Suite
10.3. Performing a Staged Deployment with Maven
10.4. Manually Uploading a Staged Deployment in Nexus
10.5. Managing Rulesets
10.6. Managing Staging Repositories in Nexus
10.7. Managing Staging Repositories with the Nexus Maven Plugin
11. Repository Health Check
12. Managing Maven Settings
12.1. Introduction
12.2. Manage Maven Settings Templates
12.3. Downloading Maven Settings with the Nexus Maven Plugin
13. OSGi Bundle Repositories
13.1. Introduction
13.2. Proxy OSGi Bundle Repositories
13.3. Hosted OSGi Bundle Repositories
13.4. Virtual OSGi Bundle Repositories
13.5. Grouping OSGi Bundle Repositories
14. P2 Repositories
14.1. Introduction
14.2. Proxy P2 Repositories
14.3. Grouping P2 Repositories
15. .NET Package Repositories
15.1. Introduction
15.2. NuGet Proxy Repositories
15.3. NuGet Hosted Repositories
15.4. NuGet Virtual Repositories
15.5. NuGet Group Repositories
15.6. Accessing Packages in Repositories and Groups
15.7. Deploying Packages to NuGet Hosted Repositories
15.8. Integration of Nexus NuGet Repositories in Visual Studio
16. Deploying Sites to Nexus
16.1. Introduction
16.2. Creating a New Maven Project
16.3. Configuring Maven for Site Deployment
16.4. Adding Credentials to Your Maven Settings
16.5. Creating a Maven Site Repository
16.6. Add the Site Deployment Role
16.7. Publishing a Maven Site to Nexus
17. Custom Metadata Plugin
17.1. Introduction
17.2. Viewing Artifact Metadata
17.3. Editing Artifact Metadata
17.4. Searching Artifact Metadata
18. User Account Plugin
18.1. Introduction
18.2. Installing the User Account Plugin
18.3. Configuring the User Account Plugin
18.4. Signing Up for an Account
18.5. Manual Activation of New Users
18.6. Modifying Default User Permissions
19. Nexus Atlassian Crowd Plugin
19.1. Introduction
19.2. Installing the Crowd Plugin
19.3. Configuring the Crowd Plugin
19.4. Crowd Access Settings
19.5. Adding the Crowd Authentication Realm
19.6. Configuring a Nexus Application in Crowd
19.7. Mapping Crowd Groups to Nexus Roles
19.8. Adding a Crowd Role to a Nexus User
20. Artifact Bundles
20.1. Introduction
20.2. Creating an Artifact Bundle from a Maven Project
20.3. Uploading an Artifact Bundle to Nexus
21. Nexus Best Practises
21.1. Introduction
21.2. Repositories per Project/Team
21.3. Partition Shared Repositories
22. Developing Nexus Plugins
22.1. Nexus Plugins
22.2. Nexus Extension Points
22.3. Nexus Plugin Extension Points
22.4. Nexus Plugin Extension
22.5. Nexus Index HTML Customizer
22.6. Static Plugin Resources
22.7. Plugin Templates
22.8. Event Inspectors
22.9. Content Generators
22.10. Content Classes
22.11. Storage Implementations
22.12. Repository Customization
22.13. Item and File Inspectors
22.14. Nexus Feeds
22.15. Nexus Tasks and Task Configuration
22.16. Application Customization
22.17. Request Processing
22.18. Using the Nexus Plugin Archetype
22.19. Set the Target Nexus Version
22.20. Building a Nexus Plugin Project
22.21. Creating a Complex Plugin
22.22. Nexus Plugin Descriptor Maven Plugin
22.23. The Nexus Plugin Descriptor
22.24. Defining Custom Repository Types
A. Migrating to Nexus from Artifactory
A.1. Introduction
A.2. Creating an Artifactory Backup
A.3. Installation of the Migration Plugin and Artifactory Bridge
A.4. Importing an Artifactory System Backup
A.5. Configuring the Artifactory Import
A.6. Configuring Artifactory Group Imports
A.7. Configuring Artifactory Repository Imports
A.8. Configuring Users and Privileges in the Artifactory Import
A.9. Performing the Artifactory Import
A.10. Configuring Artifactory Clients to Use Nexus
B. Migrating to Nexus from Archiva
B.1. Introduction
B.2. Migrating Archiva Repositories
B.3. Migrating an Archiva Managed Repository
B.4. Migrating an Archiva Proxy Connector
C. Configuring Nexus for SSL
C.1. Introduction
C.2. Importing a SSL Client Certificate
C.3. Configuring Nexus to Serve SSL
C.4. Redirecting Non-SSL Connections to SSL
D. Contributing to the Nexus Book
D.1. Contributor License Agreement (CLA)
D.2. Contributors, Authors, and Editors
D.3. Tools Used to Build and Write this Book
D.4. How to Build the Book
D.5. Subscribing to the Book Developers List
E. Copyright
F. Creative Commons License
F.1. Creative Commons BY-NC-ND 3.0 US License
F.2. Creative Commons Notice

List of Figures

3.1. Downloading Nexus Open Source
3.2. Selecting the Nexus Open Source Distribution Download
3.3. Nexus Application Window
3.4. Nexus Login Dialog (default login/password is admin/admin123)
3.5. Nexus Professional Licensing Panel
3.6. Nexus Professional End-user License Agreement
3.7. License Upload Finished Dialog
3.8. Uninstall License Confirmation Dialog
3.9. License Uninstall Completed Dialog
3.10. The Sonatype Work Directory
4.1. Creating a New Proxy Repository
4.2. Configuring a Proxy Repository
4.3. Adding New Repositories to a Nexus Group
5.1. Nexus Interface for Anonymous Users
5.2. Browsing a Repository Storage
5.3. Browsing a Repository Index
5.4. Viewing the Artifact Information
5.5. Viewing the Maven Information
5.6. Using the Archive Browser
5.7. View an Artifact’s Dependencies
5.8. Browsing a Nexus Group
5.9. Browsing a Nexus Group Index
5.10. Results of an Artifact Search for "junit"
5.11. Sort and Column Options in the Search Results Table
5.12. Advanced Search Results for a GAV Search Activated by the Show All Versions Link
5.13. Configuring Nexus as an OpenSearch Provider
5.14. OpenSearch Search Results in Nexus
5.15. Nexus Available as an Option in the Firefox OpenSearch Provider List
5.16. Artifact Upload Form
5.17. Browsing Nexus System Feeds
5.18. Browsing Nexus Logs and Configuration
5.19. Selecting the Update Frequency when Tailing a Log File
5.20. Changing Your Nexus Password
5.21. Generating a Nexus Problem Report
6.1. Administration Menu in the Left Hand Panel
6.2. Administration SMTP Settings
6.3. Administration HTTP Request Settings
6.4. Administration Security Settings
6.5. Administration Error Reporting Settings
6.6. Sonatype Issue Tracker
6.7. Signing Up for a Sonatype Issue Tracker Account
6.8. Administration Application Server Settings
6.9. Administration Default HTTP Proxy Settings
6.10. Administration System Notification Settings
6.11. Administration New Version Availability
6.12. Administration PGP Key Server Information
6.13. Repository Configuration Screen for a Proxy Repository
6.14. Repository Configuration Screen for a Proxy Repository
6.15. Proxy Configuration Access Settings for a Hosted Repository
6.16. Configuring Mirrors for Proxy Repositories
6.17. Repository Summary Panel for a Hosted Repository
6.18. Repository Summary Panel for a Proxy Repository
6.19. Repository Summary Panel for a Virtual Repository
6.20. Configuring Remote Repository Auto Block/Unblock
6.21. Group Configuration Screen in Nexus
6.22. Routes Configuration Screen in Nexus
6.23. Managing Nexus Scheduled Tasks
6.24. Configuring a Scheduled Backup of Nexus Configuration
6.25. Managing Security Privileges
6.26. Managing Security Privileges
6.27. Create, Delete, Read, and Update Privileges Created
6.28. Managing Repository Targets
6.29. Managing Repository Targets
6.30. Viewing the List of Defined Roles
6.31. Creating a New Role
6.32. Viewing an Internal Role
6.33. Managing Security Roles
6.34. Managing Users
6.35. Adding Roles to a User
6.36. Nexus User Role Tree
6.37. Nexus User Privilege Trace
6.38. The Log Configuration Panel
6.39. Plugin Console
6.40. Documentation Website for the Core API
7.1. Global Configuration for Smart Proxy
7.2. Copying a Certificate
7.3. Adding a Trusted Certificate
7.4. Smart Proxy Settings for a Hosted Repository
7.5. Smart Proxy Settings for a Proxy Repository
7.6. Subscription with Smart Proxy Connected
8.1. Adding the LDAP Authentication Realm to Available Realms
8.2. Move the LDAP Authentication Realm to the Top of Selected
8.3. LDAP Configuration Option in the Nexus Menu
8.4. Configuring Nexus LDAP for Active Directory
8.5. Checking the User and Group Mapping in LDAP Configuration
8.6. Viewing All Configured Users
8.7. All Default Realm Users
8.8. All LDAP Users
8.9. Search LDAP Users
8.10. Mapping the Deployment Role to an External User
8.11. Selecting External Role Mapping in the Role Management Panel
8.12. Selecting an Externally Managed Role to Map to a Nexus Role
8.13. Mapping an External Role to a Nexus Role
8.14. Defining Multiple LDAP Servers in Nexus Professional
8.15. Use Multiple LDAP Servers in a Fail-over Scenario
8.16. Supporting Multiple LDAP Schemas with Nexus Professional
8.17. Setting the LDAP Query Cache Duration (in Seconds)
8.18. Setting the LDAP Connection Timeout (in Seconds)
8.19. Using User & Group Mapping Templates
8.20. Testing a User Login
8.21. Supply a User’s Login Credentials
9.1. Procurement to a Certified Release Repository
9.2. Procurement to a Certified Development Repository
9.3. Enabling Remote Index Downloads for a Proxy Repository
9.4. Verification that the Remote Index has been Downloaded
9.5. Adding a Hosted Repository
9.6. Adding the "Secured" Hosted Repository
9.7. Adding a Procured Repository
9.8. Configuring Procurement for a Hosted Repository
9.9. Hosted Repository is a Nexus Managed Proxy Repository while Procurement is Active
9.10. Viewing a Repository in the Artifact Procurement Interface
9.11. Denying Procurement for Everything Under a Group
9.12. Allowing Access to a Single Artifact in a Denied Group
9.13. Viewing the Effect of Composite Procurement Rules on the Tree
9.14. Effective Procurement Rules for a Particular Node
9.15. Stopping Procurement for a Procured Repository
10.1. Without the Nexus Staging Suite
10.2. With Nexus Staging Suite
10.3. Supplying a Description for a Staging Release
10.4. Multi-level Staging and Build Promotion
10.5. Enterprise Menu after Staging Suite Installation
10.6. Adding a Repository Target for com.sonatype.sample
10.7. Multi-level Staging and Build Promotion
10.8. Editing a Staging Profile
10.9. Multi-level Staging and Build Promotion
10.10. Configuring a Build Promotion Profile
10.11. Assigning the Staging Deployer Role to the deployment user
10.12. Uploading a Staged Deployment in Nexus
10.13. Creating a Staging Ruleset
10.14. Associating a Staging Ruleset with a Staging Profile
10.15. Listing Repositories Associated with a Staging Profile
10.16. Confirmation and Description Dialog for Closing a Staging Repository
10.17. Closed Repository After Selecting Finish
10.18. Staging Repository Added to the End of a Repository Group
10.19. Viewing Nexus Managed Repositories
10.20. Browsing a Staging Repository
10.21. Browsing Repository via Staging Profiles
10.22. Promoting a Staging Repository
10.23. Selecting the Destination Repository for Staged Repository Promotion
10.24. Confirmation Dialog for Repository Promotion
10.25. Promoting a Staging Repository
10.26. Multi-level Staging and Build Promotion
10.27. Multi-level Staging and Build Promotion
10.28. Releasing, Promoting, and Dropping Build Promotion Profiles
10.29. Promoting Multiple Repositories to the Same Build Promotion Profile
11.1. The Repositories List with Different Quality Status Indicators and Result Counts
11.2. A Result Summary Window for a Repository Health Check
11.3. Summary of the Detailed Repository Health Check Panel
11.4. The Security Data in the Detailed Repository Health Check Report
11.5. The License Data in the Detailed Repository Health Check Report
12.1. The Maven Settings Panel
13.1. Creating an OSGi Bundle Proxy Repository
13.2. Creating a Hosted OSGi Bundle Repository
13.3. Creating a Virtual OSGi Bundle Repository from a Maven Repository
13.4. Creating a new OSGi Bundle Repository Group
14.1. Creating a P2 Proxy Repository
14.2. Creating a new P2 Repository Group
15.1. NuGet Proxy Repository Configuration for nuget.org
15.2. NuGet Gallery with Package Source URL
15.3. NuGet Proxy Repository Scheduled Task
15.4. Example Configuration for a NuGet Hosted Repository for Release Packages
15.5. The NuPkg Upload Panel for a Hosted NuGet Repository
15.6. A Virtual NuGet Repository for the Maven Releases Repository
15.7. A Public Nuget Group Combining a Proxy and Two Hosted Repositories
15.8. Viewing and Resetting the NuGet API Key in the NuGet Configuration Tab
15.9. Package Source Configuration for the Package Manager in Visual Studio to Access A Nexus NuGet Repository Group
16.1. Adding a Hosted Repository
16.2. Creating a New Maven Site Repository
16.3. Newly Created Maven Site Repository
16.4. Adding the Site Deployment Role to the Deployment User
16.5. Sample Site Maven Project Web Site
17.1. Viewing Artifact Metadata
17.2. Editing Artifact Metadata
17.3. Searching Artifact Metadata
17.4. Metadata Search Results for Custom Metadata
17.5. Metadata Search Results for Custom Metadata
18.1. Configuring the User Account Plugin
18.2. Sign Up Link Available for All Nexus Users
18.3. Nexus Sign Up Form
18.4. Nexus Sign Up Confirmation
18.5. Nexus Activation Email
18.6. Nexus Activation Email
18.7. User Interface with only the Base UI Privileges
18.8. Selecting Default Roles for New Users
19.1. Crowd Menu Link under the Security Section of the Nexus Menu
19.2. Crowd Configuration Panel
19.3. Crowd Access Settings
19.4. Crowd HTTP Settings
19.5. Crowd HTTP Proxy Settings
19.6. Crowd Miscellaneous Settings
19.7. Configuring the Crowd Authentication Realm
19.8. Creating a Nexus Crowd Application
19.9. Creating a Nexus Crowd Application Connection
19.10. Creating a Nexus Crowd Application Directories
19.11. Creating a Nexus Crowd Application Authorization
19.12. Adding an External Role Mapping
19.13. Mapping an External Crowd Group to a Nexus Role
19.14. Two Crowd Groups Mapped to Nexus Roles
19.15. Crowd Groups for User "brian"
19.16. Adding an External User Role Mapping
19.17. Locating a Crowd User in the User Role Mapping Dialog
19.18. Adding a Nexus Role to a Crowd User
20.1. Staging Upload Link
20.2. Uploading an Artifact Bundle
20.3. Staging Repository Created for Artifact Bundle Upload
20.4. Promoting a Staged Repository
20.5. Confirmation that Staged Repository has been Promoted
22.1. Layout of a Nexus Plugin Project
A.1. Creating an Artifactory System Export
A.2. Artifactory Import Panel from the Nexus Migration Plugin
A.3. Specifying the Artifactory System Backup Path
A.4. Configuring the Artifactory Import
A.5. Configuring Artifactory Group Imports
A.6. Merging a Proxy Repository During Artifactory Import
A.7. Configuring Users During Artifactory Import
A.8. Loading Artifactory Configuration Warning
A.9. Artifactory Import Scheduled Dialog
A.10. Viewing the Migration Logs
B.1. Archiva Managed Repositories
B.2. Editing an Archiva Managed Repository
B.3. Creating a Nexus Hosted Repository
B.4. Rebuilding the Index of a Nexus Hosted Repository
B.5. Browsing Archiva Remote Repositories
B.6. Archiva Proxy Connectors
B.7. Archiva Proxy Connector Settings
B.8. Creating a Nexus Proxy Repository
B.9. Adding a Proxy Repository to a Repository Group
B.10. Defining Nexus Repository Groups
Sonatype Promotion Subscribe via RSS