For a number of reasons you might want to require your developers to use a staging repository. Staged software releases in Nexus Professional are the best way to enable your development team to push a release to an artifact repository such as Nexus while providing management and quality assurance with a way to test and approve a release before "burning" it to production. If you want to learn how to make a staged release, you can watch this video. or read the remainder of this blog post.
First step, is to download Nexus Professional if you don't already have it installed, you can do so, by going to the Nexus Professional product page and clicking on the download link in the right-hand menu. Once you've downloaded Nexus, log in as an administrator as you must have administrative rights to perform the following configuration:
- From Nexus, click on the 'Repositories' link in left navigation.
- Click on the repository you want to use, or create one (If you need help with that take a look at the Nexus book, here)
- Click on the 'Configuration' tab.
- Set the 'Allow Deployment' field to false.
- Click the Save button.
That is it! Users will not be able to deploy or upload artifacts directly to the repository. All artifacts must be staged and promoted to this repository. For more information on staging and promoting take a look at this, or with the maven plugin, here.
Create a Staging repository
To create a staging repository:
- From Nexus, click on the 'Staging' link in left navigation.
- Click the 'Add' button then the 'Staging Profile' item.
- Enter the following information:
- Profile Name: Staging Demo Profile
- Profile Repository Target: All (Maven2)
- Staging Repository ID Template: staging-demo
- Staging Repository Name Template: Staging Demo
- Staging Repository Template: Default Release Hosted Repository Template
- Target Groups: Public Releases
- Click the 'Save' button
Assign permissions to users
A new role is created for each staging profile that is created ( in this example the role is 'Staging Deployer: (Staging Demo Profile)'). Assign the new role to your users. You can find more details on user management, here.
![Picture of Brian Demers](https://www.sonatype.com/hubfs/brian%20d.jpeg)
Written by Brian Demers
Brian is a Developer Advocate at Okta. He has a strong knowledge of Java including experience with an array of java and web-base technologies, along with involvement in open source communities.