<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sonatype Blog &#187; Brian Fox</title>
	<atom:link href="http://www.sonatype.com/people/author/brian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sonatype.com/people</link>
	<description>State-of-the-Art Build Production for the Modern Software Enterprise</description>
	<lastBuildDate>Fri, 19 Mar 2010 19:18:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Now Available: m2eclipse 0.10.0</title>
		<link>http://www.sonatype.com/people/2010/02/now-available-m2eclipse-0-10-0/</link>
		<comments>http://www.sonatype.com/people/2010/02/now-available-m2eclipse-0-10-0/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 09:00:06 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[m2eclipse]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=4347</guid>
		<description><![CDATA[
		
		
		
		This is the first production release of m2eclipse in more than a year, and it couldn’t come any sooner.  In this release, you’ll find that we’ve separated the update sites. There is now a core update site and an extras update site which contains optional components.  For more details about the installation, please read the [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2010/02/now-available-m2eclipse-0-10-0/";
		var dzone_title = "Now Available: m2eclipse 0.10.0";
		var dzone_style = "1";
		var dzone_blurb = "This is the first production release of m2eclipse in more than a year, and it couldn’t come any sooner.  In this release, you’ll find that we’ve separated the update sites. There is now a core update site and an extras update site which contains...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p><a href="http://m2eclipse.sonatype.org/installing-m2eclipse.html"><img class="alignright size-full wp-image-4348" title="install-m2eclipse-button" src="http://www.sonatype.com/people/wp-content/uploads/2010/02/install-m2eclipse-button.png" alt="" width="172" height="64" /></a>This is the first production release of m2eclipse in more than a year, and it couldn’t come any sooner.  In this release, you’ll find that we’ve separated the update sites. There is now a core update site and an extras update site which contains optional components.  For more details about the installation, please read the <a href="http://m2eclipse.sonatype.org/installing-m2eclipse.html">installation instructions</a> on the <a href="http://m2eclipse.sonatype.org">m2eclipse site</a>.</p>

<p><strong>One important note about the 0.10.0 release: you cannot upgrade from 0.9.8 or 0.9.9-dev. You must either uninstall the previous version from your Eclipse installation, or you should start with a new installation of Eclipse</strong>.  The recommended version of Eclipse for this release is 3.5.1.  You can download this eclipse distribution from <a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a>.    The rest of this post details what is new and noteworthy about the m2eclipse 0.10.0 release.<span id="more-4347"></span></p>

<h3>What’s New and Noteworthy in this release?</h3>

<ul>
    <li><strong>Stability</strong> &#8211; We’ve spent the last year working on stability and performance. If you are used to using m2eclipse 0.9.8, you’ll notice a remarkable performance improvement between these two versions.</li>
</ul>

<ul>
    <li><strong>Integrated with Maven 3.0</strong> &#8211; This release of m2eclipse includes Maven 3.0-alpha-6+. One of the primary drivers of the Maven 3.0 effort was to reimplement some of the &#8220;guts&#8221; of Maven to make it easier to embed within frameworks like the Eclipse IDE. If you are wondering what changes need to be made to your projects to use Maven 3.0, the answer is &#8220;none&#8221;. Maven 3.0 is a revolutionary upgrade that will enable the next generation of development tools, but you don’t have change a thing in your project. It should all just work.
<ul>
    <li>Compatibility with Maven 3.0 CLI behaviour</li>
    <li>Major performance improvements compared to 0.9.8</li>
    <li>Full support for proxy/mirror/auth configuration as per settings.xml</li>
    <li><strong>Note for Maven 2 Users:</strong> If you need to configure m2eclipse to use a Maven 2 installation, you can do so in the m2eclipse preferences.</li>
</ul>
</li>
</ul>

<ul>
    <li><strong>Maven Project Lifecycle Mapping framework</strong> &#8211; This framework gives you the ability to customize the Maven plugins and plugin goals which are involved in your development cycle. If you need to configure the Maven Resources plugin to update resources every time your project is built within Eclipse, there is a new tab available in the m2eclipse POM Editor.
<ul>
    <li>Developed using the new Project Configurator API</li>
    <li>Eclipse project configuration and build can be fully customized for project types and individual projects</li>
    <li>Implementation of plexus-build-api to allow mojos participate in eclipse incremental/full builds</li>
    <li>Support for modello, plexus metadata, antlr3, build-helper, resources (from site-extras)</li>
</ul>
</li>
</ul>

<ul>
    <li><strong>Reimplemented nexus-indexer integration and repositories view</strong> &#8211; m2eclipse is very tightly integrated with the Nexus indexer, and it uses it to quickly locate dependencies and artifacts. This release adds a new Repositories View which gives you the ability to inspect, modify, and manage the Maven repositories (including your Local Maven Repository) in an easy-to-use interface.
<ul>
    <li>m2eclipse now tracks repositories defined in settings.xml and project pom.xml files</li>
    <li>New option for disabled, min, or full index details for each Repository</li>
    <li>Supports the new Incremental Index Standard</li>
    <li>Remote index files are cached in maven local repository and shared between workspaces, as a result workspace initialization in m2eclipse is much faster.</li>
</ul>
</li>
</ul>

<ul>
    <li><strong>Preliminary eclipse 3.6 support</strong> &#8211; While we don’t yet recommend the use of Eclipse 3.6, this release does start to add preliminary support for the platform.</li>
</ul>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/02/now-available-m2eclipse-0-10-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Approaches to User Management in Nexus</title>
		<link>http://www.sonatype.com/people/2010/01/three-approaches-to-user-management-in-nexus/</link>
		<comments>http://www.sonatype.com/people/2010/01/three-approaches-to-user-management-in-nexus/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 19:30:57 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3866</guid>
		<description><![CDATA[
		
		
		
		When we first set out to design the external security realm (LDAP/ Crowd, etc) support in Nexus Core, we had one primary concern and that was to make it easy to integrate with systems having huge numbers of users.   Nexus was designed as a tool to be used to support the largest open source communities [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2010/01/three-approaches-to-user-management-in-nexus/";
		var dzone_title = "Three Approaches to User Management in Nexus";
		var dzone_style = "1";
		var dzone_blurb = "When we first set out to design the external security realm (LDAP/ Crowd, etc) support in Nexus Core, we had one primary concern and that was to make it easy to integrate with systems having huge numbers of users.   Nexus was designed as a tool to be...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p><!--reddZ=none--><a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/nexus-small.png"><img class="alignright size-full wp-image-3683" title="nexus-small" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/nexus-small.png" alt="" width="250" height="62" /></a>When we first set out to design the external security realm (LDAP/ Crowd, etc) support in <a href="http://nexus.sonatype.org">Nexus Core</a>, we had one primary concern and that was to make it easy to integrate with systems having huge numbers of users.   Nexus was designed as a tool to be used to support the largest open source communities with thousands of developers and hundreds of projects, and like most large enterprises, these communities have settled on solutions like LDAP, Active Directory, and Crowd as a way to manage user credentials and permissions.  A secondary concern was to support any level of integration with these external security realms, specifically:</p>

<ul>
    <li>delegating only authentication to an external server</li>
    <li>delegating both authentication and authorization to an external server</li>
    <li>delegating everything but authentication promotion permissions to an external server</li>
</ul>

<p>These interactions were gleaned from years of experience working with customers at all levels. Some have completely centralized control over passwords and roles. Others have a situation where there&#8217;s a global repository but the roles don&#8217;t match reality, or are too hard to get updated.    We wanted to create a system that would both integrate with centralized authentication servers and allow for a sensible way to override role assignments directly in Nexus.<span id="more-3866"></span></p>

<p>All of this is Core functionality works the same with all types of security realms.   We offer <a href="http://www.sonatype.com/books/nexus-book/reference/ldap.html">LDAP</a> and <a href="http://www.sonatype.com/books/nexus-book/reference/crowd.html">Crowd</a> support and the rest of this post will discuss the generic security model that works with every security realm that is available.  It is possible to define multiple external realms for Authentication and/or Authorization in the Server settings. This ordered list is used to validate credentials and select roles.  When a user attempts to authenticate in Nexus, it will iterate over the list until it can successfully authenticate a user.</p>

<h3><strong>Order Realms</strong></h3>

<p>For performance reasons it is almost always beneficial to move any external realms to the bottom of the list. Nexus will not check other realms once it finds a user. The first two realms are fast because the model is held in memory. The external realms tend to be slower, as they need to connect to a remote system.</p>

<p>Navigate to the &#8216;Server&#8217; pane, scroll down to &#8216;Security Settings&#8217; section, and move your external realms to the bottom of the list. (do not forget to save!)</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/realm-order.png"><img class="aligncenter size-full wp-image-3870" title="realm-order" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/realm-order.png" alt="" width="528" height="220" /></a></p>

<p>Now that we&#8217;ve defined the ordering, lets take the full integration approach.</p>

<h3><strong>Authentication and Authorization</strong></h3>

<p>Lots of organizations have some central user management service which has the users identity, credentials, and which groups they belong to.  Nexus is able to delegate login and authentication to that server.  For authorization we map Nexus roles to your organization&#8217;s roles/groups.   If all your users are in a group named &#8216;users&#8217;, you can map this group to a Nexus role of the same name and assign it the desired permissions.   Once a user authenticates against an external realm, their groups will match up against Nexus roles that define the specific permissions to grant.</p>

<p>To map a role, navigate to the &#8216;Roles&#8217; pane and select the &#8216;Add External Role Mapping&#8217;:</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/5-external_role1.png"><img class="aligncenter size-full wp-image-3874" title="5-external_role" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/5-external_role1.png" alt="" width="316" height="142" /></a></p>

<p>A dialog will pop up, you will need to select the security realm you are using and the group you want to be mapped.  This group is a group that is managed by the external server.   In this case, we&#8217;re mapping the &#8220;users&#8221; group in LDAP to a role in Nexus.
<a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/Mapexternal-role.png"><img class="aligncenter size-full wp-image-3871" title="Map=external-role" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/Mapexternal-role.png" alt="" width="674" height="343" /></a></p>

<p>You then need to select which Nexus roles you want to map to your organization&#8217;s group.   Here you see the new role mapping.   To add Nexus permissions for this group, just drag Nexus roles and privileges from the Available Roles / Privileges list to the Selected Roles / Privileges list.<a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/new-role-mapping.png"><img class="aligncenter size-full wp-image-3872" title="new-role-mapping" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/new-role-mapping.png" alt="" width="578" height="379" /></a></p>

<p>By mapping the external roles/groups to Nexus Roles, we are able to grant permissions to &#8220;unnamed&#8221; users. That is, ANY user that successfully authenticates against the external realm, having the group &#8220;users&#8221; will inherit the permissions granted to the Nexus &#8220;users&#8221; role. You do not need to tell Nexus about all these users ahead of time simply to assign them roles. Imagine trying to do that for 6000 users. Nexus is unique among Repository Managers with this approach.</p>

<h3><strong>Authentication only</strong></h3>

<p>Some organizations have central user management but do not maintain user groups, or the groups are unrelated to development. For this use case, Nexus can be configured to delegate the login to the server, but all the user roles are configured inside of Nexus. This provides the benefit of allowing users to use their company wide accounts while letting a Nexus administrator manage roles.</p>

<p>Go to the &#8216;Users&#8217; pane, select a user and give them a role. In the image below, I added &#8216;Nexus Developer Role&#8217; to the user &#8216;Maven&#8217;.
<a href="http://www.sonatype.com/people/wp-content/uploads/2010/01/user-auth-only.png"><img class="aligncenter size-full wp-image-3873" title="user-auth-only" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/user-auth-only.png" alt="" width="654" height="501" /></a></p>

<p>Unlike the first example, you need to manually go to each user that needs access and grant them the appropriate Nexus roles.   In this model, the Nexus administrators take on more responsibility for granting the appropriate users the appropriate level of access to the repositories they need to use.</p>

<h3><strong>Authentication Promotion</strong></h3>

<p>The last option is a combination of the two previous. The User login and list of roles are delegated to a central server, but additional roles are assigned to individual users in the Nexus UI.   In this model, Nexus administrators only need to augment roles for the few users that need to special permissions in Nexus.   For example, user Joe Coder is a developer and is part of the organization&#8217;s basic &#8216;development&#8217; group. If Joe needs helps administer Nexus, all you need to do is assign him the &#8216;Nexus Administrator Role&#8217;.</p>

<p>To assign a user a specific role or privilege, click on User in the Security menu and select the user you want to add a role or privilege to.  You should see the same interface that was shown in the previous section.   While the user will have a set of basic roles mapped from the external security realm, you can add special privileges that allow a user to promote a staged release or administer the Nexus interface.</p>

<p>In this example it is easy to see the power of Nexus&#8217;s security framework. In a few clicks you can give your whole organization access to a Nexus instance. With a few more clicks you can promote a user to and admin, or just give them access to an additional artifacts.</p>

<h3><strong><strong>Summary</strong></strong></h3>

<p>The Nexus Core security support for External realms was designed specifically to manage several different integration scenarios from full external realm delegation to mixing and matching authentication and authorization so that it could work for any type of realm and organization. Wherever possible we made sure to imagine &#8220;will this work with 6000 users?&#8221;, and this is why the role to group mapping is supported and also why we don&#8217;t attempt to list all external users anywhere by default. At the lowest levels we also took care to empower realm authors to integrate in many different ways beyond just roles and permissions. A realm gets access to the exact url and http method (get/put/post/head/delete) and thus can evaluate each request using its own set of rules if desired. This is all part of our strategy to provide the most flexible and robust Repository Manager you can find.</p>

<p>This post focused more on the theory and mechanics of managing external realms in Nexus. If  you would like to see a more end to end solution involving securing subsets of repositories, you can see <a title="Managing OSS Forges with Nexus" href="http://www.sonatype.com/people/2010/01/managing-oss-forges-with-nexus/">Managing OSS Forges with Nexus</a> as most of the topics covered there directly apply to organizations of all sizes.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/01/three-approaches-to-user-management-in-nexus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing OSS Forges with Nexus</title>
		<link>http://www.sonatype.com/people/2010/01/managing-oss-forges-with-nexus/</link>
		<comments>http://www.sonatype.com/people/2010/01/managing-oss-forges-with-nexus/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 14:46:05 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3719</guid>
		<description><![CDATA[
		
		
		
		In addition to managing and maintaining the Maven Central repository, I also serve as the administrator for two very large forge repositories: repository.apache.org and nexus.codehaus.org. This post is going to dive into the details of the best practices that I&#8217;ve developed to maintain these very large instances. I will focus on the configuration of Nexus [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2010/01/managing-oss-forges-with-nexus/";
		var dzone_title = "Managing OSS Forges with Nexus";
		var dzone_style = "1";
		var dzone_blurb = "In addition to managing and maintaining the Maven Central repository, I also serve as the administrator for two very large forge repositories: repository.apache.org and nexus.codehaus.org. This post is going to dive into the details of the best practices...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p><img class="alignright size-full wp-image-3683" title="nexus-small" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/nexus-small.png" alt="nexus-small" width="250" height="62" />In addition to managing and maintaining the Maven Central repository, I also serve as the administrator for two very large forge repositories: <a href="http://repository.apache.org">repository.apache.org</a> and <a href="http://nexus.codehaus.org">nexus.codehaus.org</a>. This post is going to dive into the details of the best practices that I&#8217;ve developed to maintain these very large instances. I will focus on the configuration of Nexus in this post, but if you&#8217;re interested in system level details, those are documented <a href="https://docs.sonatype.org/display/Repository/Home">here</a>.</p>

<p>Both of these repositories have a few things in common that have driven the design:</p>

<ul>
    <li>there are many disparate projects deploying artifacts that require fine grained access control per project</li>
    <li>release repositories are synced to central</li>
    <li>they are the most commonly used snapshot repositories in the maven ecosystem</li>
    <li>the majority of users are anonymously reading the snapshots</li>
    <li>they are transitional repositories that replace older static repositories</li>
</ul>

<p>They also have a few things that are very different:</p>

<ul>
    <li>Apache is a Solaris Zone</li>
    <li>Codehaus is an Ubuntu Jeos VM</li>
    <li>Apache is using httpd for reverse-proxying and ssl</li>
    <li>Codehaus is using Nginx for reverse-proxying and ssl</li>
</ul>

<p>This post contains two sections, the first covers some system-wide Nexus configuration, the second contains details about adding individual projects, along with security and staging configuration. If you are setting up a public Maven repository, this post might give you some ideas about configuration and administration issues that you&#8217;ll need to think about.
<span id="more-3719"></span></p>

<h3>Nexus System Configuration</h3>

<p>We want to protect all authenticated traffic, so both systems rewrite all http access to https (you can see how that&#8217;s done in the server setup linked above). However, since 99% of all traffic to these systems is anonymous, I&#8217;ve allowed the snapshot urls to poke through without being redirected.</p>

<p>Since I am using reverse proxies in front of Nexus, and the protocol doesn&#8217;t have a good way to tell Nexus what the inbound protocol was, I need to tell Nexus how to generate absolute urls that are used in the REST API. This is done by setting the following options in the server configuration pane:</p>

<p><img class="aligncenter size-full wp-image-3720" title="0-baseurl" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/0-baseurl.png" alt="0-baseurl" width="540" height="107" /></p>

<p>The systems are configured with just two hosted repositories: releases and snapshots. Both systems are transitional, meaning that projects elect to convert at a convenient time. To support this, I proxy the old snapshot repository and aggregate it with the locally hosted snapshot repo. When you hit <a href="http://repository.apache.org/snapshots">http://repository.apache.org/snapshots</a> or <a href="http://nexus.codehaus.org/snapshots">http://nexus.codehaus.org/snapshots</a>, you&#8217;re hitting this group and it appears as one repository. We also have a staging group that is used to aggregate all staging repos that haven&#8217;t yet been promoted. Here&#8217;s what the repository list looks like:</p>

<p><img class="aligncenter size-full wp-image-3721" title="0-repositories" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/0-repositories.png" alt="0-repositories" width="615" />
One benefit to using Nexus in these forge setups, is that we are able to configure rules that automatically check staged artifacts before they can be promoted. This includes things like validating the pgp signature is present and signed with a publicly accessible key, looking for sources and javadocs, validating the pom, etc. This is one way we are helping to improve the data in Central, by helping to correct it right at the source. Since these <a href="http://www.sonatype.com/books/nexus-book/reference/ch10s06.html">rules are tied in to the Staging support</a>, we want to disable the ability to deploy directly to the releases repository. This is done by setting the repository url to be read-only:</p>

<p><img class="aligncenter size-full wp-image-3722" title="0-disable-redeploy" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/0-disable-redeploy.png" alt="0-disable-redeploy" width="658" height="466" />
I also have configured the following jobs:</p>

<ul>
    <li><strong> Configuration Backup</strong> &#8211; Backs up the Nexus Configuration files. I have it set to run daily and to keep 10 days of backups</li>
    <li><strong>Publish Indexes</strong> &#8211; This packages the internal real-time indexes into a format that is consumable by downstream Nexus&#8217; and M2eclipse users (other tools consume this data as well). I have this set to run daily.</li>
    <li><strong> Purge Proxy Artifacts</strong> &#8211; Since we&#8217;re transitional and proxying the old, static snapshot repositories, I have configured a task to evict items that haven&#8217;t been requested in more than 10 days. This just reduces the disk consumption on the repo. If a file is re-requested later, it will be retrieved again from the proxy on demand.</li>
    <li><strong>Snapshot Cleanup</strong> &#8211; We want to enforce best practices and keep snapshots moving forward. The cleanup task is set to keep a maximum of 3 timestamped snapshots for each artifact for a minimum of 10 days. All snapshots for an artifact are also purged when a release is promoted.</li>
    <li><strong>Empty the trash</strong> &#8211; All delete operations in Nexus never actually delete, they just move files to a trash folder. This is a security net in case you misconfigure a cleanup task, or simply make a mistake in the ui (like dropping a repo you meant to promote). We keep on top of the trash by scheduling it to run once a week. New in 1.4 is the ability to purge things from the trash only after they have been deleted for x days. I&#8217;ve set this to hold things in the trash at least 7 days. This gives projects more than enough time to detect any issues and recover the artifacts.</li>
</ul>

<p><img class="aligncenter size-full wp-image-3723" title="10-trash" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/10-trash.png" alt="10-trash" width="591" height="357" /></p>

<h3>Project Specific Configuration</h3>

<p>Each project needs to have access to only their own artifacts. Nexus supports two different ways to handle the security separation. If you want to read more about the two modes read my previous post:<a href="http://www.sonatype.com/people/2009/06/optimal-nexus-repository-configuration/">&#8220;Optimal Nexus Repository Configuration&#8221;</a> .  We have chosen to manage the forge by partitioning a single pair of repositories. The next few steps show how this is done.</p>

<p>First, we define a new Repository Target for this project&#8217;s artifacts. Don&#8217;t worry if you&#8217;re not a regexp genius, wildcards are very easy, and we let you define multiple regexps so you don&#8217;t have to figure out more complicated and/or expressions. In the image below, I&#8217;ve created a new target called &#8220;org.codehaus.org&#8221; that will contain all artifacts in the paths /org/codehaus/mojo and below.</p>

<p><img class="aligncenter size-full wp-image-3724" title="1-repotarget" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/1-repotarget.png" alt="1-repotarget" width="650" /></p>

<p>Now that we&#8217;ve defined our &#8220;bucket&#8221; of artifacts, we need to create some permissions that are associated with it. You&#8217;re probably thinking &#8220;create permissions?&#8221; Yes, see the Repository Target is a generic concept that lets you arbitrarily group artifacts, but notice we haven&#8217;t yet associated the target with any repositories.</p>

<p style="padding-left: 30px;"><em><strong>NOTE:</strong></em><em> The logic behind this approach is that you may want to grant people read access to all org.foo artifacts, but what if you only want them to see artifacts that have been promoted and not things that are still being staged?</em></p>

<p>In this case, we want to grant CRUD (Create / Read / Update / Deleate) to SNAPSHOT artifacts, but only CRU to releases. (Admins only are allowed to delete releases, this prevents problems once things are synced to Central). I will do this in two steps as shown below. First create a set of permissions that link the org.codehaus.mojo Repository Target to &#8220;All Repositories&#8221;:</p>

<p><img class="aligncenter size-full wp-image-3732" title="2-allpriv" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/2-allpriv.png" alt="2-allpriv" width="474" height="195" /></p>

<p>Then create a set or permissions that only apply to the hosted Snapshot repository:</p>

<p><img class="aligncenter size-full wp-image-3731" title="3-snapshotpriv" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/3-snapshotpriv.png" alt="3-snapshotpriv" width="476" height="167" /></p>

<p>Both the Apache and Codehaus forges use the <a href="http://www.sonatype.com/products/nexus/features/staging_suite">Staging support</a> in conjunction with Staging rules to validate the integrity of releases.</p>

<blockquote><strong>NOTE:</strong> Nexus staging is unique in that it&#8217;s entirely controlled from the server side, which means Admins can adjust as needed without changing the poms. It&#8217;s also designed so that all projects use a single url for deployment that is abstracted from the repository, which provides two benefits: 1) you can change the repository hosting artifacts without changing poms and 2) you can specify the distributionManagement url in just one place, reducing the errors. For example, at Apache we have a parent pom that contains all the logic a project needs to be staged.</blockquote>

<p>We control this in Nexus by creating a Staging Profile. Fortunately the profile reuses the Repository Target we defined earlier:</p>

<p><img class="aligncenter size-full wp-image-3730" title="4-staging-profile" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/4-staging-profile.png" alt="4-staging-profile" width="546" height="307" /></p>

<p>Not shown are the settings that let you set the validation rules and who should be notified at each promotion step.  Now that we have defined the staging profile, the system automatically created a few new permissions that let you specify who is allowed to stage, drop and promote these artifacts. We want to grant this permissions to users and this is done via roles.</p>

<p>The Codehaus repository is linked to their LDAP system. Nexus takes a unique approach that lets you easily grant access to dozens of users without having to configure each user in the system. We do this by allowing you to &#8220;map an external role&#8221; and then grant Nexus specific permissions to any user that has this role.  To do this, navigate to the Role pane and select the Add External Role Mapping as shown below:</p>

<p><img class="aligncenter size-full wp-image-3729" title="5-external_role" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/5-external_role.png" alt="5-external_role" width="316" height="142" /></p>

<p>This brings up a dialog where you can select the external realm (you could have multiple realms), and then you will see a list of all the roles known to the external system. Here I&#8217;m selecting &#8220;mojo-developers&#8221;.</p>

<p><img class="aligncenter size-full wp-image-3728" title="6-role-mapping" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/6-role-mapping.png" alt="6-role-mapping" width="429" height="284" /></p>

<p>This creates a new role in Nexus with an id matching the external system id &#8220;mojo-developers&#8221;. Any user authenticated that has this role in the external user account will automatically be granted these permissions.</p>

<p><img class="aligncenter size-full wp-image-3727" title="mojo_-_role-config" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/mojo_-_role-config.png" alt="mojo_-_role-config" width="650" /></p>

<p>I now select the roles and permissions I want to grant. Specifically, I grant the following:</p>

<ul>
    <li><strong>Staging: Deployer (org.codehaus.mojo) </strong>- This is a role that was created when I setup the profile. It contains the basic set of permissions needed to allow a user to view, stage, close and drop org.codehaus.mojo staging repositories (only)</li>
    <li><strong>UI: Staging Repositories</strong> &#8211; This lets the user actually see the staging view, without this they couldn&#8217;t see what they staged.</li>
    <li><strong>org.codehaus.mojo &#8211; All</strong> &#8211; Here I&#8217;m granting Create, Read and Update for all matching artifacts (remember these are the permissions we created above that apply to all repositories)</li>
    <li><strong>org.codehaus.mojo &#8211; snapshots</strong>: Here I&#8217;m granting delete, but only for the org/codehaus/mojo artifacts in the Snapshot repository.</li>
    <li><strong>Staging: Profile org.codehaus.mojo &#8211; (promote)</strong>: The Staging: Deployer xxx roles give the ability to stage, but not the ability to promote. This permission may be granted to managers, qa, or PMC etc as appropriate. Here we&#8217;re letting developers stage and promote their own artifacts.</li>
</ul>

<p>And we&#8217;re done. Notice that I didn&#8217;t need to go grant permissions to every user, and I didn&#8217;t have to put the users into groups. This is the power that Nexus provides in user management. This is <em>core</em> functionality that applies to any realm you may have, not just Nexus Professional ones.</p>

<p>Now, to illustrate some more power of this approach, what if org.codehaus.mojo later starts managing artifacts under org.mojo? I don&#8217;t have to redo everything here, I just extend the Repository Target &#8220;bucket&#8221; by adding &#8220;.<em>/org/mojo/.</em>&#8221; and instantly all the permissions, staging profiles, etc apply to the new groupId. This has definitely saved me many times at Apache with the Webservices Projects&#8230; they have more groupIds than I can count, but they all map back to the same external role. Each time a new one comes along, I just add it to the target and I&#8217;m done.</p>

<h3>Automating Nexus Administration via REST</h3>

<p>This is the process we&#8217;ve ironed out over several months. I definitely don&#8217;t go through this UI clicking every time. Since Nexus has a full REST API (the UI is just a REST client built in JavaScript), we have developed a set of command line tools that take a few simple inputs like groupId, external role id and project name and automates all of this configuration via REST calls automatically. You can see those tools <a href="https://docs.sonatype.com/display/NX/Nexus+Command+Line+Tools#NexusCommandLineTools-NexusPreparationTool">here</a> and they make a great example of how to integrate Nexus into the DNA of your organization.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/01/managing-oss-forges-with-nexus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Differentiates Nexus from Other Repository Managers?</title>
		<link>http://www.sonatype.com/people/2010/01/nx-differentiate/</link>
		<comments>http://www.sonatype.com/people/2010/01/nx-differentiate/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 19:00:39 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3706</guid>
		<description><![CDATA[
		
		
		
		In &#8220;A Tale of Two Repository Managers&#8221; John Smart compares Nexus to Artifactory, and covers some of the more well known features like Staging and Security.  I wanted to emphasize a few more of the other features that are often overlooked.

Most of our users download the tool, install it, and use the most straightforward features: [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2010/01/nx-differentiate/";
		var dzone_title = "What Differentiates Nexus from Other Repository Managers?";
		var dzone_style = "1";
		var dzone_blurb = "In &#8220;A Tale of Two Repository Managers&#8221; John Smart compares Nexus to Artifactory, and covers some of the more well known features like Staging and Security.  I wanted to emphasize a few more of the other features that are often overlooked.Most...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p><img class="alignright size-full wp-image-3683" title="nexus-small" src="http://www.sonatype.com/people/wp-content/uploads/2010/01/nexus-small.png" alt="nexus-small" width="250" height="62" />In <a href="http://wakaleo.com/blog/243-a-tale-of-two-repository-managers-nexus-and-artifactory-compared-and-contrasted">&#8220;A Tale of Two Repository Managers&#8221;</a> John Smart compares Nexus to Artifactory, and covers some of the more well known features like Staging and Security.  I wanted to emphasize a few more of the other features that are often overlooked.</p>

<p>Most of our users download the tool, install it, and use the most straightforward features: simple proxy repositories, hosted repositories, and repository groups.  We&#8217;ve gone out of the way to make Nexus intuitive, but I often wonder if enough people know about some of the features offered as part of the base project.  Here are some of the features I would have highlighted in any comparison.</p>

<p><span id="more-3706"></span></p>

<h3>Mirrors / Repository Metadata Standards</h3>

<p>We manage the Central Maven repository: a free public resource used by millions of developers every single day.   This is a big part of what we do on a daily basis, and so we are acutely aware of the bandwidth being consumed serving the canonical, central repository to all the Maven, Ant, and Ivy users out there. Nexus is the only repository manager that is able to deal with mirrors in a true &#8220;mirror&#8221; fashion. Using the repository-metadata.xml if it exists, or by manual entry otherwise, Nexus is able to discover known mirrors of a repository. So when configured, Nexus is able to use a mirror that may be geographically closer to retrieve artifacts, while still falling back to the canonical repo if artifacts are missing and/or to validate checksums and pgp signatures.  (<a href="http://www.sonatype.com/people/2009/03/new-feature-in-nexus-13-mirror-support/">http://www.sonatype.com/people/2009/03/new-feature-in-nexus-13-mirror-support/</a>) This can greatly improve proxy performance without any of the downsides associated with using a mirror that could be slightly stale.   <strong>No other repository manager currently does this.</strong></p>

<h3>OpenSearch</h3>

<p>In the searching arena, Nexus also supports the OpenSearch standard, allowing searching to occur directly from the search box in your browser (<a href="http://www.sonatype.com/people/2009/06/demonstration-of-nexus-opensearch-integration/">http://www.sonatype.com/people/2009/06/demonstration-of-nexus-opensearch-integration/</a>)    If you use Firefox, how often do you load up &#8220;http://www.google.com&#8221; to perform a search?   It is a good chance that you use the search box that is integrated into your browser.    This same search box can also be configured to search a Nexus instance.    <strong>No other repository manager offers Open Search integration.</strong></p>

<h3>Indexer Standard</h3>

<p>The Nexus Indexer format is the standard that all repository managers and IDE integrations use to fetch information about the contents of a remote repository. So while it&#8217;s true that the search in Nexus isn&#8217;t as fully featured as we would like, we have spent the time instead focusing on interoperability at the index level. The standard has been updated to break the dependency on Lucene 2.3, and to support incremental index downloads. As it stands today, Nexus is the only repository manager that can produce (not just proxy) indexes that are compatible with all the Maven IDE plugins and other repository managers. We find that most users would rather do the searching within their IDE and so we are empowering those users directly via the index integration. That&#8217;s not to say we don&#8217;t have some revolutionary things up our sleeve in the Nexus Search, but I&#8217;ll save that for another forum <img src='http://www.sonatype.com/people/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p><strong>All repository managers use the repository index standard that is set by the Nexus Indexer.</strong> All repository managers benefit from the time Sonatype has invested both in the Maven project itself, the development of an open source Nexus Indexer, and our continued efforts to reduce the bandwidth burden on Central as it serves an updated repository index to a world of developers using tools that interoperate with the formats we helped design.</p>

<h3>Layout Mediation</h3>

<p>Nexus is designed to be repository layout agnostic, while &#8220;<a href="http://docs.codehaus.org/display/MAVENUSER/Maven+Repository+Manager+Feature+Matrix">Artifactory is a Maven 2 only repository manager by design.</a>&#8221; Although we got some things wrong internally in the initial Nexus releases, things have been markedly improved. Nexus is able to support Maven1, Maven2, Eclipse P2, Eclipse Update Site, OBR, and most recently RubyGems. In many cases, these formats can be converted on the fly from one to the other. For example, you can expose an OSGI Bundle Repository containing every bundle in a Maven 2 repo (yes, even Central) in just a few clicks. If you work in an environment with multiple repository standards, Nexus is your choice.   <strong>No other repository manager even comes close</strong>, our core engine with layout agnostic and we&#8217;re building a tool that will serve as a virtual &#8220;Tower of Babble&#8221;, converting between repository formats once thought incompatible.</p>

<h3>Eclipse Distribution Management</h3>

<p>One of the most overlooked features of Nexus Pro is the ability to proxy and aggregate Eclipse P2 and Eclipse Update sites. That means that all the benefits you gain by proxying and aggregating Maven repos are directly applicable to your Eclipse IDE users: Bandwidth savings, Time savings, single url management, etc. If you would like to understand more of those benefits, John Smart did a great job of enumerating them here: <a href="http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise">http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise</a></p>

<h3>Extensibility: Plugin API and REST Services</h3>

<p>Nexus has a plugin model and associated maven-archetype to make it easy to extend. Users are already adding new features like security realms, repository types and new UI capabilities.    If you take time to understand the architecture of Nexus, you&#8217;ll see that much of the functionality is implemented as a plugin.   Plugins can affect the request lifecycle in Nexus, they can define new repository types, and add new capabilities to the underlying platform.   Plugins can also customize the user interface and add new REST services.</p>

<p>Everything the Nexus web interface does is the result of some interaction with a REST service which you can access with your own custom Nexus plugins or user interface.   If you have an idea for a novel approach to using Nexus or if you want to build your own custom administrative scripts that automate certain tasks, you can do so without having to deal with user interface issues.   Nexus is the only repository manager that is built on a foundation of open REST services.   Our REST services are not just an afterthought, a feature to list in a feature matrix.   The REST services &#42;are&#42; Nexus, and you can take these core REST services and create novel tools and interfaces.</p>

<p>We were joking the other day that we&#8217;ve made Nexus so extensible, you could easily modify it to support the distribution of digital media.   You could even use the metadata search feature to capture, index, and track your iTunes library with a custom repository type.    While the discussion was facetious, the conclusion is accurate.   We&#8217;ve been focused on using Nexus to develop solid, enterprise-class tools to manage binary artifacts and the metadata they are associated with.   <em>You could use Nexus to keep track of just about anything.</em></p>

<h3>Summary</h3>

<p>In short, Nexus is more than just a Maven repository manager. It&#8217;s part of a much larger ecosystem of tools that work together with defined standards that go from the command line build, to the CI system, the IDE and to production roll out. Nexus is developed and maintained by many of the leaders in the Maven arena, is backed by full time QA and support staff, and has a full length free book available for printing at cost.</p>

<p>The team that develops Nexus is also concerned with much more than a repository manager.  The decisions we make about product features and direction are influenced by progress on the various open source projects that we participate in.   Sonatype does more than just talk about repository managers.  Through our work in the open source community, we are participating in open communities, and giving back as much as we can to the communities that support us.    In addition to working on Nexus 1.4 over the past year, our engineers have served as release managers for new versions of Maven, and they have been working round-the-clock to get projects like Maven 3, the newer polyglot extensions to Maven, and Maven shell out and available for everyone to use.</p>

<p>We&#8217;re actively involved in open source, and I&#8217;d like to think that this counts for something when you are selecting a repository manager.   Choose <a href="http://nexus.sonatype.org">Nexus Open Source</a> or <a href="http://www.sonatype.com/products/nexus">Nexus Professional</a>.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/01/nx-differentiate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Response to Maven Problems on the JBoss Wiki, Part Three</title>
		<link>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-three/</link>
		<comments>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-three/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 09:15:40 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Sonatype]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3422</guid>
		<description><![CDATA[
		
		
		
		In parts  one and two of this series, I addressed several concerns raised on the Jboss wiki. In this post, I address several more topics.

No separation of build instructions vs. general project information

both the set of build instructions (lifecycle) and general information about the project and dependency information.  IMO this is a flawed [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-three/";
		var dzone_title = "Response to Maven Problems on the JBoss Wiki, Part Three";
		var dzone_style = "1";
		var dzone_blurb = "In parts  one and two of this series, I addressed several concerns raised on the Jboss wiki. In this post, I address several more topics.No separation of build instructions vs. general project informationboth the set of build instructions (lifecycle)...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>In parts <a href="http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/"> one</a> and <a href="http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-two/">two</a> of this series, I addressed several <a href="http://www.jboss.org/community/wiki/MavenProblems">concerns</a> raised on the Jboss wiki. In this post, I address several more topics.
<span id="more-3422"></span>
<strong>No separation of build instructions vs. general project information</strong></p>

<blockquote>both the set of build instructions (lifecycle) and general information about the project and dependency information.  IMO this is a flawed model.  Instead of having a single file, there should be some separation between the build instructions and the project information needed in the repository&#8230;.When a POM is used as a dependency (not a parent) from the repository only certain information is useful to the calling project.  Information like the project identifiers (groupId, artifactId), general project information (name, description, scm, etc).  Other information is ignored: everything in the build and reporting sections, the distributionManagement&#8230;
</blockquote>

<p>I&#8217;ve had the same thoughts recently as we begin to think about dealing with POM model changes. Many of the changes we would want to make specifically only apply to the <i>&lt;build&gt;</i> section. Having separate files for this information is one way to solve the model / parsing problem, but it doesn&#8217;t solve it completely, since we also want to extend things in the dependency section like scope, global excludes, etc.</p>

<p>In hindsight, the separation may have made our work today easier, but separating it now doesn&#8217;t push us forward in a meaningful way by itself, and now we have history and convention to consider.</p>

<blockquote>If a POM is used in a parent/child relationship, then the this information will be used.  The problem with the parent/child model that Maven uses, is that build information can only be picked up from a single source.  This means that I can&#8217;t get some build configuration from one POM and other information from another.</blockquote>

<p>Yep, I addressed this in part one, but in Maven 3.x we will support the concept of &#8220;mixins&#8221; which is a way to introduce composition to the pom. This will completely solve this concern.</p>

<blockquote>The project configuration (POM) used locally is not necessarily the same as what should be released/deployed.  For example, in a local build configuration we might want to avoid using a specific version of a dependency and instead just let the dependency resolver get the latest released version.  In the repository however, the released and/or deployed POM should always specify the version of the dependency that was used during the build.  Maven recently has some workarounds for this problem such as the versions-maven-plugin which helps to keep dependency versions up to date, but the problem still exists that I have to manually use this plugin to update the dependencies.  In an ideal build tool, this functionality would be automatic.</blockquote>

<p>I tend to agree here as well. I&#8217;ve spent quite a bit of time considering how to deal with this recently, but every time I think it&#8217;s figured out, I find a reason it won&#8217;t work.</p>

<p>The implication here is that in your build you define a version of some dependency, let&#8217;s choose a range like anything between 1.0 and 2.0 not including 2.0 ( that would be <em>[1.0,2.0)</em> in the pom) . At the time I build my module, I resolve against 1.7 for some unimportant reason. My pom is deployed to the repository with a dependency version of <em>&#8220;1.7&#8243;</em>. Life seems fine.</p>

<p>Someone else comes along and depends upon my JAR. He wants to use 2.1, since the deployed POM now says 1.7, my range information has been lost and Maven doesn&#8217;t know that the developer has really said that it only works with 1.x.</p>

<p>In summary, replacing the requested version with the version resolved at build time results in a loss of fidelity that may affect consumers of my JAR.</p>

<p>One solution to this may be to include the resolved version alongside the requested version in the deployed POM, but we&#8217;d have to think through what the resolution strategy would do differently in this case.</p>

<p><strong>No easy way to add plugin configurations to a lifecycle</strong></p>

<blockquote>An&#8230; example is the compile vs. test-compile goals, these two goals are the same logic with a slightly different configuration.  Ant has a single compile task and compile vs. test-compile is just a different configuration of the same task.</blockquote>

<p>It is technically possible for us to change the lifecycle configuration to allow the plugin config to be defined, and you&#8217;re right this would allow some plugin goals to be collapsed down into one.</p>

<p>However, we would need to think through the implications of tying the config into the lifecycle when it comes to plugin versions. If the lifecycle defines some default configuration that changes between plugin versions, what happens when the user chooses that version in their pom?</p>

<p>Currently you almost never have to change a lifecycle, and you especially don&#8217;t have to do it to support different plugin versions. I feel like linking the lifecycle and plugin this tightly would cause more problems than it solves.</p>

<p>After all, if you code your plugin correctly, making another goal with slightly different default parameters is a trivial endeavor.</p>

<p><strong>Limited Access to the Build Lifecycle.</strong></p>

<blockquote>There is no simple way in Maven to add a new phase to the build lifecycle.</blockquote>

<p>Absolutely and I think that&#8217;s a benefit of Maven not a problem. If you have any Maven build, you can sit down and know immediately how to run tests, compile, package etc. You don&#8217;t have to go read the build file to see if it&#8217;s &#8220;clean-test, test-clean, jar, package&#8221; etc.</p>

<p>Every Maven build has the exact same set of targets and it should always stay that way.</p>

<p><strong>No way to handle renamed artifacts and/or link two dependency resolution IDs</strong></p>

<blockquote>There are many situations where it would be useful to link two dependency IDs to tell Maven that the two IDs refer to the same artifact.  For example when a dependency is moved to a new groupId, the old groupId/artifactId is treated as a completely separate artifact.  The old groupId/artifactId must then be excluded from each location where it appears in the dependency tree.  Maven should have a way to link these together and ignore any occurrences of the old groupId/artifactId.</blockquote>

<p>This has always been supported with the relocation element. See:</p>

<ul><li><a href="http://maven.apache.org/guides/mini/guide-relocation.html">http://maven.apache.org/guides/mini/guide-relocation.html</a></li><li>
<a href="http://maven.apache.org/ref/2.2.1/maven-model/maven.html#class_relocation">http://maven.apache.org/ref/2.2.1/maven-model/maven.html#class_relocation</a></li></ul>

<p><strong>Maven only allows a single source directory per project</strong></p>

<blockquote>In some cases it&#8217;s useful to separate source code into multiple directories that have different compilation parameters.  Unfortunately this is not allowed in Maven.</blockquote>

<p>While it&#8217;s true that the POM model only allows a single source directory in the POM, Maven internally supports as many source folders as you want.</p>

<p>Typically additional source folders are needed in cases where code is generated and you want to keep that separate from your code that needs to be in SCM. The plugin that does the generation is responsible for adding the additional folder directly into the model in memory.</p>

<p>The build-helper plugin has <a href="http://mojo.codehaus.org/build-helper-maven-plugin/add-source-mojo.html">goals</a> to allow you to attach arbitrary folders if you need them. Perhaps when we solve the POM model problem, we can consider allowing multiple source folders directly in the POM. It&#8217;s probably already possible to do this with the <a href="http://www.sonatype.com/people/2009/11/maven-3x-paving-the-desire-lines-part-two/">polyglot stuff</a> Jason has been working on.</p>

<p>Stay tuned for part 4 to see the conclusion.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-three/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Response to Maven Problems on the JBoss Wiki, Part Two</title>
		<link>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-two/</link>
		<comments>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-two/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 09:40:51 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Sonatype]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3342</guid>
		<description><![CDATA[
		
		
		
		In part one of this series, I addressed several concerns raised on the a Jboss wiki. In this post, I specifically focus on the issues raised with the release plugin.

The wiki states:

The release process is not reliable Maven projects use the maven release plugin to help automate the release.  Unfortunately we have experienced numerous [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-two/";
		var dzone_title = "Response to Maven Problems on the JBoss Wiki, Part Two";
		var dzone_style = "1";
		var dzone_blurb = "In part one of this series, I addressed several concerns raised on the a Jboss wiki. In this post, I specifically focus on the issues raised with the release plugin.The wiki states:The release process is not reliable Maven projects use the maven release...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>In <a href="http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/">part one</a> of this series, I addressed several <a href="http://www.jboss.org/community/wiki/MavenProblems">concerns</a> raised on the a Jboss wiki. In this post, I specifically focus on the issues raised with the release plugin.</p>

<p>The wiki states:<span id="more-3342"></span></p>

<blockquote><strong>The release process is not reliable</strong> Maven projects use the maven release plugin to help automate the release.  Unfortunately we have experienced numerous problems with this plugin.  The problem is not so much the bugs in the plugin&#8230;.I think a lot of the problems with the release plugin stem from two things&#8230;</blockquote>

<p>Before we dive in further, the idea behind the release plugin is that most releases follow these general steps:</p>

<ol>
<li>Build and verify that the tests pass</li>
<li>Tag it</li>
<li>Checkout and build the tag to be sure what you tagged is in fact correct</li>
<li>Publish the artifacts of the build for testing</li>
</ol>

<p>The release plugin handles steps 1 and 2 in the <em>release:prepare</em> goal. Steps 3 and 4 are done by <em>release:perform</em>.</p>

<p>Maven&#8217;s normal development process adds a few extra steps in there regarding the conversion of the versions from SNAPSHOTS to releases, but the above steps are generally what is being automated.</p>

<p>In addition to automating the testing and tagging process, the plugin also makes sure you don&#8217;t:</p>

<ul><li>have uncommitted changes</li>
<li>depend on any snapshots</li>
</ul>

<p>It&#8217;s worth noting here that there is no requirement to use the release plugin. It&#8217;s meant to encapsulate best practices and generally make life easier for maven projects, but if it doesn&#8217;t, don&#8217;t use it. It&#8217;s a plugin and the logic isn&#8217;t baked into Maven core.</p>

<blockquote><b>One is the svn tag and checkout.</b>  Because these are not done prior to the start of the release process, if there are any problems with these steps they will block a release. They can be difficult to debug because the release plugin forces the whole process to restart in order to solve the issue. Manually doing a tag and checkout is much easier because issues with svn can be resolved by themselves outside of the release plugin automation process.</blockquote>

<p>If you were to manually tag and checkout something, I presume you would have built it first to make sure your tests pass? You&#8217;re asking the release plugin to pickup at step 3 above and let you do steps 1 and 2 manually, at that point you might as well not even use the release plugin and just run &#8216;mvn deploy&#8217;.</p>

<p>The release plugin has a state machine that keeps track of the last step that successfully passed. This means it doesn&#8217;t require you to start back at the beginning if something fails during the prepare process. It is true that if errors are encountered during perform that require changing code, you will have to redo the tags. There is a rollback goal to handle this.</p>

<blockquote><b>The second major issue comes from changing the version numbers in the pom at release time.</b>  The POM versions are changed automatically by the release plugin.  This seems like a good thing at first, but it can cause unforseen problems in multimodule projects that need to resolve inter-module dependencies.  Sometimes dependency resolution errors are found only at release time because the new versions do not yet exist in the maven repository.  This is another area where a more manual process would be preferred in many cases because the multiple step nature of the release plugin can make debugging difficult and time consuming.</blockquote>

<p>The changing of the version numbers isn&#8217;t directly the problem here but it is a trigger. There are some weird interactions with some plugins and the reactor that can cause them to not resolve things that aren&#8217;t in the local repository. This has been significantly improved in Maven 3.x but it&#8217;s impossible to say if all plugins will work correctly yet. Some, like the dependency plugin may need updates to find things in the reactor.</p>

<p>Generally speaking though, it is possible to make your build behave correctly in a perfect clean-room scenario (i.e. where no snapshots of this project exist yet), and if it does that, releasing won&#8217;t be a problem. If it doesn&#8217;t, that&#8217;s an indicator that the build might need a few tweaks.</p>

<p>For all maven projects I currently work on at Sonatype and at Apache, the release plugin works perfectly. The key to this is that most of these projects were setup originally as Maven2 projects and thus follow all the best practices.</p>

<h3>However</h3>

<p>That said, I&#8217;m also not a huge fan of the current release plugin and have had troubles with it on other projects, so I totally sympathize. My main beef is that while the steps in the release plugin are appropriate for most projects, sometimes they just don&#8217;t fit yours.</p>

<p>I would like to see the release process become more like a lifecycle, and each individual action bound like a plugin to a phase. Then you can totally rewire the steps in the order that makes most sense for your project.</p>

<p>I have built the equivalent of the release steps as enforcer goals over the years working in the direction of a pluggable release lifecycle. It is possible today with the enforcer to string together all the validations into your own release process, completely bypassing the release plugin all together. That leaves you to manually tag, checkout and manipulate the versions, but sometimes that&#8217;s just what you need/want to do.</p>

<p>All that&#8217;s needed is someone to put the time in to create this new release plugin.</p>

<p>Part 3 will address the rest of the issues raised.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/12/response-to-maven-problems-on-the-jboss-wiki-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A year of providing free Maven repository hosting</title>
		<link>http://www.sonatype.com/people/2009/11/a-year-of-providing-free-maven-repository-hosting/</link>
		<comments>http://www.sonatype.com/people/2009/11/a-year-of-providing-free-maven-repository-hosting/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 02:30:40 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Sonatype]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3388</guid>
		<description><![CDATA[
		
		
		
		I was doing a little digging for some old emails recently and realized that it&#8217;s been over a year that oss.sonatype.org has been available for free Maven repository hosting of Open Source projects.

The first was plexus, naturally since Maven and Nexus are both currently built on top of plexus.

Our first real external &#8220;customer&#8221; on oss.sonatype.org [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/11/a-year-of-providing-free-maven-repository-hosting/";
		var dzone_title = "A year of providing free Maven repository hosting";
		var dzone_style = "1";
		var dzone_blurb = "I was doing a little digging for some old emails recently and realized that it&#8217;s been over a year that oss.sonatype.org has been available for free Maven repository hosting of Open Source projects.The first was plexus, naturally since Maven and...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I was doing a little digging for some old emails recently and realized that it&#8217;s been over a year that <a href="http://oss.sonatype.org">oss.sonatype.org</a> has been available for free Maven repository hosting of Open Source projects.</p>

<p>The first was <a href="http://fisheye.codehaus.org/changelog/plexus?cs=7762">plexus</a>, naturally since Maven and Nexus are both currently built on top of plexus.</p>

<p>Our first real external &#8220;customer&#8221; on oss.sonatype.org was the <a href="http://blogs.webtide.com/gregw/entry/maven_m2e_and_the_nexus">Jetty</a> project, followed by <a href="http://raibledesigns.com/rd/entry/nexus_is_a_kick_ass">Appfuse</a> and OpenSymphony.</p>

<p>We now have over 81 projects actively using the system to host, stage and sync their artifacts to Central. The repository is hosted on a machine at <a href="http://www.contegix.com">Contegix</a> that is racked up next to the Maven Central repository, making it possible to sync new releases over hourly, not to mention that it is also extremely reliable.</p>

<p>If you have an Open Source project looking for a better way to stage your artifacts and promote them to Central go <a href="http://nexus.sonatype.org/oss-repository-hosting.html">here</a> to get started. We&#8217;ll even help you migrate your existing artifacts.</p>

<p>We also provide free Nexus Professional licenses to projects or forges that would rather run their own system. You may request a license by filling out this form: <a href="http://sonatype.com/products/nexus/professional/oss">http://sonatype.com/products/nexus/professional/oss</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/11/a-year-of-providing-free-maven-repository-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Response to Maven Problems on the JBoss Wiki, Part One</title>
		<link>http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/</link>
		<comments>http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:00:35 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Sonatype]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3335</guid>
		<description><![CDATA[
		
		
		
		I was recently pointed to a list of Maven Problems maintained on the JBoss wiki. This is actually a great summary of areas to improve, and I&#8217;m not surprised that the list is very close to the list of issues that the Maven community has been working to address over the past few months.  [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/";
		var dzone_title = "Response to Maven Problems on the JBoss Wiki, Part One";
		var dzone_style = "1";
		var dzone_blurb = "I was recently pointed to a list of Maven Problems maintained on the JBoss wiki. This is actually a great summary of areas to improve, and I&#8217;m not surprised that the list is very close to the list of issues that the Maven community has been working...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I was recently pointed to a <a href="http://www.jboss.org/community/wiki/MavenProblems">list</a> of Maven Problems maintained on the JBoss wiki. This is actually a great summary of areas to improve, and I&#8217;m not surprised that the list is very close to the list of issues that the Maven community has been working to address over the past few months.  In this post, I&#8217;ll take this chance to address each of the points raised on the JBoss Wiki.</p>

<p><span id="more-3335"></span></p>

<p><strong>Issue: No easy way to test multiple dependency configurations</strong></p>

<blockquote>Some projects, such as Hibernate would benefit from an easy way to configure multiple dependency configurations.  This is especially useful for setting up multiple test configurations.</blockquote>

<p>Being able to depend upon, or import, a specific set of dependencies was introduced in Maven 2.0.9 with a new &#8220;import scope&#8221; that allows you to import the dependencyManagement section from another pom. This works in some cases, but it was essentially a hack to introduce new functionality without changing the POM format.</p>

<p>A little background info: Maven 2.x has always used a POM model version 4.0.0, and the parsers in 2.x are not capable of understanding newer versions. This is a pretty significant issue that the team is well aware of since moving to a new model is required for most of the powerful things we need to do going forward. For now, it&#8217;s not clear how to do this in a way that allows projects built with a new model to be consumed by users of older versions of Maven. We have many ideas and could fill a whole blog post on that topic alone. Lets just say this is an unresolved blocker for solving issues like this.</p>

<p>What we specifically need to do to address this problem is to create a new first class element called TargetPlatform (to steal a term from the Eclipse world). This would allow better support of groups of dependencies that represent the runtime environment. Without changing the model, it isn&#8217;t possible to define these platforms in a useful way.</p>

<p><strong>Issue: Maven builds are significantly slower than Ant builds.</strong></p>

<blockquote>A full build of the App server would take about 5-6 minutes and an incremental build about 1-2 minutes.  With Maven, the build takes about 10-12 minutes for a full build and 3-5 minutes for an incremental build.  Having fast incremental builds is very important to facilitate development.</blockquote>

<p>I don&#8217;t think this is an apples-to-apples comparison. Maven by default executes your unit tests, which naturally takes longer. It&#8217;s been a while since I significantly used Ant, but the last I knew, it was not exactly incremental either.</p>

<p><b>Maven 3.x takes a significant step forward in performance.</b> We now have a specific suite of performance tests that enable us to measure the impact of changes on the build performance. Because of this, Maven 3.x is anywhere from 25% &#8211; 2x faster than 2.x. Most of these changes have come about as part of improving the performance of the embedder and plugins for the upcoming M2eclipse .9.9 release. Specifically, an incremental build interface has been defined and several key plugins are now updated to use it. This means that in M2e builds, we can tightly integrate with the Eclipse builder and provide a list of things (files) a given plugin depends upon, and then communicate back the files that plugin has actually touched. This is the first step in being able to support full incremental build from the CLI, as many more plugins will need to implement the new interface before builds can become truly incremental like a good make based build can be.</p>

<p><strong>Issue: Building a subset of modules</strong></p>

<p>I definitely missed this from my Make days and long ago wrote a <a href="http://docs.codehaus.org/display/MAVEN/Make+Like+Reactor+Mode">proposal</a> for it. Dan Fabulich picked this up and implemented it first as a plugin for 2.0.x and then in the 2.1.x core.   You can read about these <A href="http://www.sonatype.com/books/mvnref-book/reference/ch06s02.html">Advanced Reactor Options in Maven: The Complete Reference</a>.</p>

<p><strong>Issue: Maven is limited for of sharing configuration</strong></p>

<blockquote>For example, in a multi-module build I might want to have a set of properties that are generated before any module build.  This could be something like generate a timestamp, get the current svn revision, etc.  In Maven these properties must be set separately for each module.  If there was better support for shared module tasks, the properties configuration could be run before any module and the properties would easily be available to all the modules.</blockquote>

<p>Currently the only way to share configuration is via inheritance. For example in Apache projects, we have a pretty robust toolchain for building our releases. If you want to use this in your project, you would have to copy all the associated XML since it wouldn&#8217;t make sense to inherit from our POMs.</p>

<p>We are working on a concept called &#8220;mixins&#8221; which is essentially composition in the poms. This will allow you to deploy and then later depend upon snippets of POM XML to compose your build.</p>

<p><strong>Issue: One artifact per project rule</strong></p>

<blockquote>Maven has a general rule that there should be only a single artifact per project.  This is important to maven dependency resolution, because there is only one set of dependencies in the POM.  If multiple artifacts are generated in by a single POM (this commonly done by the assembly plugin) then there is no way to list a separate set of dependencies for the non-primary artifact.  Maven projects also often include a -sources jar and a -javadocs jar.  There is no intuitive way to generate a source jar for a secondary project jar.  For example if my project includes a &#8220;-client&#8221; jar, then I might also want something like a &#8220;-client-sources&#8221; jar.<strong></strong></blockquote>

<p>The idea here is to encourage separation of concerns. Traditionally people lump API, client and, server code into a giant build that spits out multiple artifacts. The way this is intended to work in Maven  is that each one is it&#8217;s own project. For the most part, this holds up under all kinds of scenarios.</p>

<p>However, I have seen some issues when tools like Axis are used to generate the client and server directly from some other definition. There isn&#8217;t currently a clean solution for this when the resulting JARs have different dependencies. We&#8217;ve kicked around a few ideas, but no solid proposal exists yet.</p>

<p>I&#8217;ll address the rest in part two of this post.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/11/response-to-maven-problems-on-the-jboss-wiki-part-one/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Features in Nexus and Nexus Professional 1.4</title>
		<link>http://www.sonatype.com/people/2009/10/new-features-in-nexus-and-nexus-professional-14/</link>
		<comments>http://www.sonatype.com/people/2009/10/new-features-in-nexus-and-nexus-professional-14/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:22:07 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Mercury]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[nexus pro]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3075</guid>
		<description><![CDATA[
		
		
		
		The Nexus Professional 1.4 release offers a wide array of features


    Proxy Repository Browsing &#8211; 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.

    Publishing [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/10/new-features-in-nexus-and-nexus-professional-14/";
		var dzone_title = "New Features in Nexus and Nexus Professional 1.4";
		var dzone_style = "1";
		var dzone_blurb = "The Nexus Professional 1.4 release offers a wide array of features    Proxy Repository Browsing &#8211; 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...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>The Nexus Professional 1.4 release offers a wide array of features</p>

<ul>
    <li><strong>Proxy Repository Browsing</strong> &#8211; 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.
<img class="aligncenter size-medium wp-image-3087" title="repository-manager_browse-repository-index" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/repository-manager_browse-repository-index-273x300.png" alt="repository-manager_browse-repository-index" width="273" height="300" /></li>
    <li><strong>Publishing Web Sites to Nexus Professional</strong> &#8211; 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&#8217;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.
<img class="aligncenter size-medium wp-image-3089" title="sites-new-repo" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/sites-new-repo-300x168.png" alt="sites-new-repo" width="300" height="168" /></li>
    <li><strong>Repository Configuration Changes</strong>
<ul>
    <li><strong>Fine-grained control of Redeployment for Hosted Repositories:</strong> 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.<img class="aligncenter size-medium wp-image-3090" title="repository-manager_repository-config-3" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/repository-manager_repository-config-3-300x179.png" alt="repository-manager_repository-config-3" width="300" height="179" /></li>
</ul>
</li>
    <li><strong>Improvements to the Staging Plugin</strong> &#8211; 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.
<ul>
    <li><strong>Support for Staging Rulesets:</strong> 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 <a href="http://repository.apache.org">Apache repository</a> and our <a href="http://oss.sonatype.org">OSS hosting repository</a></li>
    <li><strong>Support for Uploading Artifact Bundles:</strong> 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.</li>
    <li><strong>General Usability Improvements in the Staging Plugin:</strong> 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.</li>
</ul>
</li>
    <li><strong>User Account Plugin</strong> &#8211; 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.
<img class="aligncenter size-medium wp-image-3092" title="user-account_sign-up-form" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/user-account_sign-up-form-300x261.png" alt="user-account_sign-up-form" width="300" height="261" /></li>
    <li><strong>Repository Summary Panel</strong> &#8211; 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.
<img class="aligncenter size-medium wp-image-3093" title="repository-manager_summary-hosted" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/repository-manager_summary-hosted-293x300.png" alt="repository-manager_summary-hosted" width="293" height="300" /></li>
    <li><strong>Security Improvements</strong> &#8211; 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.
<ul>
    <li><strong>New User Role Tree:</strong> 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.
<img class="aligncenter size-medium wp-image-3094" title="repository-manager_security-users-role-tree" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/repository-manager_security-users-role-tree-300x275.png" alt="repository-manager_security-users-role-tree" width="300" height="275" /></li>
    <li><strong>New User Privilege Trace feature:</strong> 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.
<img class="aligncenter size-medium wp-image-3095" title="repository-manager_security-users-privilege" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/repository-manager_security-users-privilege-300x275.png" alt="repository-manager_security-users-privilege" width="300" height="275" /></li>
    <li><strong>New Role Tree:</strong> Since a Nexus role can consist of both roles and privileges, we&#8217;ve provided an intuitive tree browser that allows an administrator to browse the hierarchy of roles and privileges associated with a Nexus Role.</li>
    <li><strong>Fine-grained control of View Repository Privilege:</strong> 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.</li>
</ul>
</li>
    <li><strong>Integration with Atlassian Crowd</strong> &#8211; Atlassian Crowd is a capable user and directory management system that can consolidate authorization and authentication to a central server.  Nexus Professional&#8217;s Atlassian Crowd plugin provides seamless integration between Nexus and Atlassian&#8217;s Crowd server.
<img class="aligncenter size-medium wp-image-3096" title="crowd_server-config-access-settings" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/crowd_server-config-access-settings-300x119.png" alt="crowd_server-config-access-settings" width="300" height="119" /></li>
    <li><strong>Automated Nexus Error Reporting</strong> &#8211; 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&#8217;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.</li>
    <li><strong>Upgrades to the Nexus Book</strong>
<ul>
    <li>A new chapter on Nexus Best Practices.</li>
    <li>A new chapter on publishing web sites to Nexus.</li>
    <li>Over 100 corrections and clarifications.</li>
    <li>Over 80 new figures and diagrams.</li>
    <li>Addition of a New Nexus Book Cover with the Nexus Logo</li>
</ul>
<img class="aligncenter size-medium wp-image-3098" title="nexus-book-cover-01" src="http://www.sonatype.com/people/wp-content/uploads/2009/10/nexus-book-cover-01-230x300.png" alt="nexus-book-cover-01" width="230" height="300" /></li>
</ul>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/10/new-features-in-nexus-and-nexus-professional-14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Tips and Tricks: Optimizing with the Maven Dependency Plugin</title>
		<link>http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-optimizing-with-the-maven-dependency-plugin/</link>
		<comments>http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-optimizing-with-the-maven-dependency-plugin/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:05:30 +0000</pubDate>
		<dc:creator>Brian Fox</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3224</guid>
		<description><![CDATA[
		
		
		
		On larger projects, additional dependencies often tend to creep into a POM as the number of dependencies grow. As dependencies change, you are often left with dependencies that are not being used, and just as often, you may forget to declare explicit dependencies for libraries you require. Because Maven 2.x includes transitive dependencies in the [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-optimizing-with-the-maven-dependency-plugin/";
		var dzone_title = "Maven Tips and Tricks: Optimizing with the Maven Dependency Plugin";
		var dzone_style = "1";
		var dzone_blurb = "On larger projects, additional dependencies often tend to creep into a POM as the number of dependencies grow. As dependencies change, you are often left with dependencies that are not being used, and just as often, you may forget to declare explicit...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>On larger projects, additional dependencies often tend to creep into a POM as the number of dependencies grow. As dependencies change, you are often left with dependencies that are not being used, and just as often, you may forget to declare explicit dependencies for libraries you require. Because Maven 2.x includes transitive dependencies in the compile scope, your project may compile properly but fail to run in production. Consider a case where a project uses classes from a widely used project such as Jakarta Commons BeanUtils. Instead of declaring an explicit dependency on BeanUtils, your project simply relies on a project like Hibernate that references BeanUtils as a transitive dependency. Your project may compile successfully and run just fine, but if you upgrade to a new version of Hibernate that doesn’t depend on BeanUtils, you’ll start to get compile and runtime errors, and it won’t be immediately obvious why your project stopped compiling. Also, because you haven’t explicitly listed a dependency version, Maven cannot resolve any version conflicts that may arise.
<span id="more-3224"></span></p>

<p>A good rule of thumb in Maven is to always declare explicit dependencies for classes referenced in your code. If you are going to be importing Commons BeanUtils classes, you should also be declaring a direct dependency on Commons BeanUtils. Fortunately, via bytecode analysis, the Maven Dependency plugin is able to assist you in uncovering direct references to dependencies. Using the updated POMs we previously optimized, let’s look to see if any errors pop up:</p>

<pre>$ mvn dependency:analyze
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Chapter 8 Simple Parent Project
[INFO]   Chapter 8 Simple Object Model
[INFO]   Chapter 8 Simple Weather API
[INFO]   Chapter 8 Simple Persistence API
[INFO]   Chapter 8 Simple Command Line Tool
[INFO]   Chapter 8 Simple Web Application
[INFO]   Chapter 8 Parent Project
[INFO] Searching repository for plugin with prefix: 'dependency'.

...

[INFO] ------------------------------------------------------------------------
[INFO] Building Chapter 8 Simple Object Model
[INFO]    task-segment: [dependency:analyze]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing dependency:analyze
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [dependency:analyze]
[WARNING] Used undeclared dependencies found:
[WARNING]    javax.persistence:persistence-api:jar:1.0:compile
[WARNING] Unused declared dependencies found:
[WARNING]    org.hibernate:hibernate-annotations:jar:3.3.0.ga:compile
[WARNING]    org.hibernate:hibernate:jar:3.2.5.ga:compile
[WARNING]    junit:junit:jar:3.8.1:test

...

[INFO] ------------------------------------------------------------------------
[INFO] Building Chapter 8 Simple Web Application
[INFO]    task-segment: [dependency:analyze]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing dependency:analyze
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [dependency:analyze]
[WARNING] Used undeclared dependencies found:
[WARNING]    org.sonatype.mavenbook.optimize:simple-model:jar:1.0:compile
[WARNING] Unused declared dependencies found:
[WARNING]    org.apache.velocity:velocity:jar:1.5:compile
[WARNING]    javax.servlet:jstl:jar:1.1.2:compile
[WARNING]    taglibs:standard:jar:1.1.2:compile
[WARNING]    junit:junit:jar:3.8.1:test</pre>

<p>In the truncated output just shown, you can see the output of the dependency:analyze  goal. This goal analyzes the project to see whether there are any indirect dependencies, or dependencies that are being referenced but are not directly declared. In the simple-model project, the Dependency plugin indicates a “used undeclared dependency” on javax.persistence:persistence-api. To investigate further, go to the simple-model directory and run the dependency:tree goal, which will list all of the project’s direct and transitive dependencies:</p>

<pre>$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Chapter 8 Simple Object Model
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree]
[INFO] org.sonatype.mavenbook.optimize:simple-model:jar:1.0
[INFO] +- org.hibernate:hibernate-annotations:jar:3.3.0.ga:compile
[INFO] |  \- javax.persistence:persistence-api:jar:1.0:compile
[INFO] +- org.hibernate:hibernate:jar:3.2.5.ga:compile
[INFO] |  +- net.sf.ehcache:ehcache:jar:1.2.3:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] |  +- asm:asm-attrs:jar:1.5.3:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- antlr:antlr:jar:2.7.6:compile
[INFO] |  +- cglib:cglib:jar:2.1_3:compile
[INFO] |  +- asm:asm:jar:1.5.3:compile
[INFO] |  \- commons-collections:commons-collections:jar:2.1.1:compile
[INFO] \- junit:junit:jar:3.8.1:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
</pre>

<p>From this output, we can see that the persistence-api dependency is coming from hibernate. A cursory scan of the source in this module will reveal many javax.persistence  import statements confirming that we are, indeed, directly referencing this dependency. The simple fix is to add a direct reference to the dependency. In this example, we put the dependency version in simple-parent’s dependencyManagement  section because the dependency is linked to Hibernate, and the Hibernate version is declared here. Eventually you are going to want to upgrade your project’s version of Hibernate. Listing the persistence-api dependency version near the Hibernate dependency version will make it more obvious later when your team modifies the parent POM to upgrade the Hibernate version.</p>

<p>If you look at the dependency:analyze output from the simple-web module, you will see that we also need to add a direct reference to the simple-model dependency. The code in simple-webapp directly references the model objects in simple-model, and the simple-model is exposed to simple-webapp as a transitive dependency via simple-persist. Since this is a sibling dependency that shares both the version and groupId, the dependency can be defined in simple-webapp’s pom.xml using the ${project.groupId} and ${project.version}.</p>

<p>How did the Maven Dependency plugin uncover these issues? How does dependency:analyze know which classes and dependencies are directly referenced by your project’s bytecode? The Dependency plugin uses the ObjectWeb ASM (http://asm.objectweb.org/) toolkit to analyze the raw bytecode. The Dependency plugin uses ASM to walk through all the classes in the current project, and it builds a list of every other class referenced. It then walks through all the dependencies, direct and transitive, and marks off the classes discovered in the direct dependencies. Any classes not located in the direct dependencies are discovered in the transitive dependencies, and the list of “used, undeclared dependencies” is produced.</p>

<p>In contrast, the list of unused, declared dependencies is a little trickier to validate, and less useful than the “used, undeclared dependencies.” For one, some dependencies are used only at runtime or for tests, and they won’t be found in the bytecode. These are pretty obvious when you see them in the output; for example, JUnit appears in this list, but this is expected because it is used only for unit tests. You’ll also notice that the Velocity and Servlet API dependencies are listed in this list for the simple-web module. This is also expected because, although the project doesn’t have any direct references to the classes of these artifacts, they are still essential during runtime.</p>

<p>Be careful when removing any unused, declared dependencies unless you have very good test coverage, or you might introduce a runtime error. A more sinister issue pops up with bytecode optimization. For example, it is legal for a compiler to substitute the value of a constant and optimize away the reference. Removing this dependency will cause the compile to fail, yet the tool shows it as unused. Future versions of the Maven Dependency plugin will provide better techniques for detecting and/or ignoring these types of issues.</p>

<p>You should use the dependency:analyze tool periodically to detect these common errors in your projects. It can be configured to fail the build if certain conditions are found, and it is also available as a report.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-optimizing-with-the-maven-dependency-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
