Tag Archives: nexus pro

Nexus as Open Source Infrastructure: User Sign-Up


November 24, 2009 By Tim O'Brien

If you’ve ever participated in an open source community like the Apache Software Foundation or Codehaus, you’ll know that there are hundreds (sometimes thousands) of participants and interested parties for projects such as Maven, httpd, or Tomcat. Communities like these are only able to communicate because individuals can sign up for mailing lists, issues trackers, and other open source infrastructure without the manual intervention of an administrator. If you want to submit a bug to the Groovy project at Codehaus, you don’t have to send an email to someone asking permission to participate, you simply sign up for an account on the Codehaus JIRA. It just would be as agile a community if you need to wait for an administrator’s permission to participate.

It is this self-service sign-up capability that is a key feature of all scalable open-source infrastructure, and this is also one of the key features that was just released in Nexus Professional (which is also freely available for any interested open source project).

Bringing Open Source to the Enteprise

While this self-service sign-up is important for open source projects, it can also be something useful to the enterprise. Many large software development organizations have realized that the collaborative, open-source development model provides an example for internal development. If an organization can emulate the ad-hoc, merit-driven models of something like the Apache Software Foundation, they can start to gain some of the benefits of open source culture and open source community. I’ve spoken with many executives at large organizations who understand that they need to find a way to bring the “ethos” of open-source into the enterprise. One way to encourage this change is to start using the same infrastructure as open source projects: Nexus, JIRA, Subversion. Another way to bring open-source best practices into the enterprise is to allow for more ad-hoc, user-driven action. Give your developers something like Nexus, and don’t put an administrator in the way. Let them sign up for accounts using the User Account Plugin.

In this post, I provide a brief overview of user-driven sign-up feature just released with Nexus Professional 1.4.0.

Continue reading

Nexus Professional's Support for Atlassian Crowd


November 17, 2009 By Tim O'Brien

Atlassian’s Crowd is a single sign-on and identity management product that many organizations use to consolidate user accounts and control which users and groups have access to which applications. Nexus Professional contains an optional security plugin that allows you to configure Nexus to authenticate against an Atlassian Crowd instance. This blog post dives into the details of Nexus Pro’s Crowd support, and provides some first steps to configuring your Nexus Pro instance to authenticate against your Crowd server.

Continue reading

Nexus Tips and Tricks: Publishing Maven Sites to Nexus 1.4


November 10, 2009 By Tim O'Brien

Nexus Professional provides a new hosted repository type: a Maven Site repository. This repository can be used to hold a Maven-generated web site. In addition to publishing your artifacts to a Nexus repository, you can also use Nexus to serve your project’s web sites.

Configuring Maven for Site Deployment

To deploy a site to a Nexus Professional Maven Site repository, you will need to configure the project’s distribution management settings, add site deployment information, and then update your Maven settings to include the appropriate credentials for Nexus. Add the following section to sample-site/pom.xml after the dependencies element. This section will tell Maven where to publish the Maven-generated project web site:

 <distributionManagement>
    <site>
      <id>nexus-site</id>
      <url>dav:http://localhost:8081/nexus/content/sites/site/</url>
    </site>
  </distributionManagement>

In addition to the distributionManagement element, you will want to add the following build element that will configure Maven to use version 2.0.1 of the Maven Site plugin. Site deployment to Nexus Professional requires version 2.0.1 or higher of the Maven Site Plugin.

 <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>2.0.1</version>
      </plugin>
    </plugins>
  </build>

Adding Credentials to Your Maven Settings

When the Maven Site plugin deploys a site to Nexus, it will need to supply the appropriate deployment credentials to Nexus. To configure this, you will need to add credentials to your Maven Settings. Open up your ~/.m2/settings.xml and add the following server configuration to the servers element. If you already have a servers element, just add a new server element with the appropriate id, username, and password. This example uses the default deployment user and the default deployment user password for Nexus.

<settings>
  <servers>
    <server>
      <id>nexus-site</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
  </servers>
 </settings>

Creating a Maven Site Repository

To create a Maven Site Repository, log in as a user with Administrative privileges, and click on “Repositories” under Views/Repositories in the Nexus menu. Under the Repositories tab, click on the Add… dropdown and choose “Hosted Repository” as shown in the following figure.

In the New Hosted Repository form, click on the Repository Type dropdown and chose the Maven Site Repository format as shown in the next figure. Although you can use any arbitrary name and identifier for your own Nexus repository, for the chapter’s example, use a Repository ID of “site” and a Repository Name of “Maven Site”.

After creating a new Maven Site repository, it should appear in the listed of Nexus repositories as shown in the next figure.

Add the Site Deployment Role

In the Maven Settings shown previously, you configured your Maven instance to use the default deployment user and password. To successfully deploy a site to Nexus, you will need to make sure that the deployment user has the appropriate role and permissions. To add the site deployment role to the deployment user, click on Users under the Security section of the Nexus menu, and then highlight the deployment user as shown in the next figure.

Locate the “Repo: All Maven Site Repositories (Full Control)” role in the Available Roles list, click this role, and drag it over to the Selected Roles list. Once the role is in the Selected Roles list, click on the Save button to update the roles for the deployment user. The deployment user will now have the ability to publish sites to a Maven Site repository.

Publishing a Site to Nexus

To publish a site to a Maven Site repository in Nexus Professional, run mvn site site:deploy from your project’s base directory. The Maven Site plugin will deploy this site to Nexus using the credentials stored in your Maven Settings.

~/examples/sample-site$ mvn site site:deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-site
[INFO]    task-segment: [site, site:deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [site:site {execution: default-site}]
[INFO] Generating "About" report.
[INFO] Generating "Issue Tracking" report.
[INFO] Generating "Project Team" report.
[INFO] Generating "Dependencies" report.
[INFO] Generating "Project Plugins" report.
[INFO] Generating "Continuous Integration" report.
[INFO] Generating "Source Repository" report.
[INFO] Generating "Project License" report.
[INFO] Generating "Mailing Lists" report.
[INFO] Generating "Plugin Management" report.
[INFO] Generating "Project Summary" report.
[INFO] [site:deploy {execution: default-cli}]
http://localhost:8081/nexus/content/sites/site/ - Session: Opened
Uploading: ./css/maven-base.css to http://localhost:8081/nexus/content/sites/site/
#http://localhost:8081/nexus/content/sites/site//./css/maven-base.css \
- Status code: 201
Transfer finished. 2297 bytes copied in 0.052 seconds
Uploading: ./css/maven-theme.css to http://localhost:8081/nexus/content/sites/site/
#http://localhost:8081/nexus/content/sites/site//./css/maven-theme.css \
- Status code: 201
Transfer finished. 2801 bytes copied in 0.017 seconds
Transfer finished. 5235 bytes copied in 0.012 seconds
http://localhost:8081/nexus/content/sites/site/ - Session: Disconnecting
http://localhost:8081/nexus/content/sites/site/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45 seconds
[INFO] Finished at: Sat Oct 03 07:52:35 CDT 2009
[INFO] Final Memory: 35M/80M
[INFO] ------------------------

Once the site has been publish, you can load the site in a browser by going to http://localhost:8081/nexus/content/sites/site/.

Nexus Tips: Disable Redeployment in Nexus


November 2, 2009 By Brian Demers

It’s a fundamental tenet of Maven that release artifacts never change once they are released. This is enforced in Maven by the fact that once a release artifact or POM is located in the local repository, Maven will never check for an updated artifact in a remote repository. Once an artifact is released, it is considered a static, unchanging artifact. If you release an artifact and then subsequently change it (intentionally or otherwise), you’re in for some fun as people will have different versions based on when they first retrieved it… that’s a situation not exactly conducive to a repeatable, standard build. This blog post discusses a feature in Nexus 1.4 which can enforce this rule and help you avoid problems caused by the redeployment of release artifacts.

Continue reading

New Features in Nexus and Nexus Professional 1.4


October 28, 2009 By Brian Fox

The Nexus Professional 1.4 release offers a wide array of features

  • Proxy Repository Browsing – With Nexus 1.4, the local cache and logical index views have been separated into separate tabs. We found that the previous single tab with a combo box to select the source was confusing. repository-manager_browse-repository-index
  • Publishing Web Sites to Nexus Professional – Nexus Professional 1.4 provides you with a WebDAV endpoint for publishing a web site. You can configure a Site repository that can be used as a publishing destination for project documentation. This means you don’t have to worry about providing some alternate solution to host your reports. The full support of Nexus security applies to this new type of repository, so you can control access at a very fine grained level. sites-new-repo
  • Repository Configuration Changes
    • Fine-grained control of Redeployment for Hosted Repositories: Nexus 1.4 provides administrators a simplied way to control how a hosted repository deals with the redeployment of artifacts. You can configure a repository to allow for the redeployment of previously deployed artifacts, allow for one-time deployment, or to provide a read-only interface for clients.repository-manager_repository-config-3
  • Improvements to the Staging Plugin – The staging plugin had numerous improvements in the 1.4 release to increase usability and provide new functions for staging artifact bundle and verifying that staging repositories follow user configurable rule sets.
    • Support for Staging Rulesets: Nexus Professional 1.4 provides administrators with the ability to define a set of rules to apply to staging repositories before they can be promoted. The 1.4 release can validate that staging repositories contain valid POMs, valid PGP signatures, javadocs, and sources for all artifacts. The rules are pluggable and we expect to add more rules in the near future to support the Apache repository and our OSS hosting repository
    • Support for Uploading Artifact Bundles: The staging plugin now accepts artifact bundle uploads. Artifact bundles are archives which contain one or more associated artifacts, they are used to publish artifacts to the Central Maven repository, and you can use Artifact bundles to validate artifacts uploaded to Nexus.
    • General Usability Improvements in the Staging Plugin: This release of the Staging plugin focused on usability, the Staging plugin is full of improvements that make the user interface more intuitive and easier to use.
  • User Account Plugin – The User Account Plugin in Nexus Professional gives unauthenticated Nexus users the ability to sign-up for a Nexus account. When this feature is enabled, a new user would click a sign-up link, fill out a simple profile form, read a captcha, and then activate a new account via an email confirmation message. Nexus Administrators can configure the default roles and permissions that are granted to newly signed up users. user-account_sign-up-form
  • Repository Summary Panel – The repository summary panel provides statistics and configuration information for a specific repository. Users can consult the repository summary panel to gather the necessary distribution management settings for Maven configuration. repository-manager_summary-hosted
  • Security Improvements – Many improvements to the user security model. In general, it is now easier to configure custom role mappings for externally managed users, and Sonatype has paid close attention to the user interface for managing users and roles. It is easier than ever to configure and secure a Nexus repository.
    • New User Role Tree: Click on a user and then click on the user role tree to see how each role contributes to the permissions for a particular user. repository-manager_security-users-role-tree
    • New User Privilege Trace feature: this features allows Nexus administrators to pinpoint which roles contribute which permissions to a particular user. While the user role tree provides an intuitive interface that lists role in a hierarchy, the privilege trace panel under user administration provides an alternate view. Click on a particular permission to find the roles contribute that permission to a user. repository-manager_security-users-privilege
    • New Role Tree: Since a Nexus role can consist of both roles and privileges, we’ve provided an intuitive tree browser that allows an administrator to browse the hierarchy of roles and privileges associated with a Nexus Role.
    • Fine-grained control of View Repository Privilege: Nexus added the ability to configure a role to prevent users from browsing particular repositories. This is used to provide a cleaner view to users, for example to show them only groups they use via Maven and not confuse them with all the repositories aggregated by that group.
  • Integration with Atlassian Crowd – Atlassian Crowd is a capable user and directory management system that can consolidate authorization and authentication to a central server. Nexus Professional’s Atlassian Crowd plugin provides seamless integration between Nexus and Atlassian’s Crowd server. crowd_server-config-access-settings
  • Automated Nexus Error Reporting – Nexus 1.4 ships with an automated error repository system which can be configured to report Nexus exceptions and errors to the Nexus Issue Tracker. If configured, the system will send data to Sonatype’s Jira instance. The information contained includes the configuration (all passwords are obfuscated) as well as a file list of the repositories and exception traces. All of this data is encrypted using public-key cryptography so only Sonatype can view the contents. We expect that this information will allow us to further refine the stability of Nexus.
  • Upgrades to the Nexus Book
    • A new chapter on Nexus Best Practices.
    • A new chapter on publishing web sites to Nexus.
    • Over 100 corrections and clarifications.
    • Over 80 new figures and diagrams.
    • Addition of a New Nexus Book Cover with the Nexus Logo
    nexus-book-cover-01