<?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; ant</title>
	<atom:link href="http://www.sonatype.com/people/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sonatype.com/people</link>
	<description>Sonatype is transforming software development with tools, information and services that enable organizations to build better software, faster, using open-source components.</description>
	<lastBuildDate>Wed, 23 May 2012 14:24:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to Migrate from Ant to Maven: Project Structure</title>
		<link>http://www.sonatype.com/people/2010/08/how-to-migrate-from-ant-to-maven-project-structure/</link>
		<comments>http://www.sonatype.com/people/2010/08/how-to-migrate-from-ant-to-maven-project-structure/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 06:00:26 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[ant]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=6119</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/08/how-to-migrate-from-ant-to-maven-project-structure/' addthis:title='How to Migrate from Ant to Maven: Project Structure '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I&#8217;ve seen my fair share of projects migrating from Ant to Maven, and, for a complex project, this migration path can take some time. You have to worry about dependency management, project structure, and retraining an existing team to use Maven and understand the core concepts behind the tool. When you make the shift, you [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/08/how-to-migrate-from-ant-to-maven-project-structure/' addthis:title='How to Migrate from Ant to Maven: Project Structure '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I&#8217;ve seen my fair share of projects migrating from Ant to Maven, and, for a complex project, this migration path can take some time.  You have to worry about dependency management, project structure, and retraining an existing team to use Maven and understand the core concepts behind the tool.  When you make the shift, you are often affecting development infrastructure for an existing project, and you need to take into account development environments as well as developer&#8217;s ideas about how code should be organized and stored in source control.   In this post, I&#8217;m going to discuss a common pattern I&#8217;ve seen in Ant to Maven migrations: how to migrate the monolithic project.</p>

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

<h3>A Common Pattern: The Monolithic Project</h3>

<p>Ant projects which have evolved over many years often lack modular structure.   While it is certainly possible to create the equivalent of a multi-module Maven project in Ant, the usual progression in an Ant project is to store all of your source in a single tree and use extra targets to selectively compile different packages.   This approach is shown in the following figure.</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure.png"><img src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure.png" alt="" title="ant-migrate-structure" width="445" height="348" class="aligncenter size-full wp-image-6120" /></a></p>

<p>In the most extreme cases, there is a single project which contains an array of modules.   Maybe you have an entire enterprise system all stored in a single project alongside a complex Ant build.xml file which contains a collection of tasks for each component.   A monolithic Ant project usually produces a series of artifacts: a JAR containing some API for clients, a server-side web application, a utility library, etc.   Developers have usually grown so accustomed to this approach that the idea of splitting up a complex system into a series of related submodules can see daunting.</p>

<h3>Moving to Maven: Do we need all these projects?</h3>

<p>One of the first questions I get in a Maven migration from Ant is whether it is really necessary to modularize a project.  &#8220;Do we really need to create all these projects for Maven?&#8221;    (Short answer: Yes, there is no avoiding this.)   This is usually accompanied by a concern that Maven limits each project to producing a single artifact.   These are two core assumptions of Maven: your projects will be modularized and each project should produce a single build artifact.</p>

<p>Now, while these are core assumptions, there are ways around them, and I&#8217;ve even seen people go to extreme lengths in an attempt to preserve this single, monolithic project.   You can create an elaborate set of profiles to modify the build depending on the context in which it is run, and you can attach extra build artifacts to a project using assemblies.   Even though Maven makes assumptions about code layout and project structure, it can do just about anything, and in this case, it can be used to approximate the monolithic, combined Ant project.</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure-misguided.png"><img src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure-misguided.png" alt="" title="ant-migrate-structure-misguided" width="508" height="482" class="aligncenter size-full wp-image-6122" /></a></p>

<p>If you do this, if you try to trick Maven the first thing you&#8217;ll notice is that your monolithic project&#8217;s POM is going to be somewhat unwieldy: it is going to be massive.   Instead of a simple, declarative picture of a project, you are going to have a POM that contains multiple assembly definitions.  Each assembly definition is going to have to explicitly define the structure of your build artifacts and you are going to find yourself venturing into includes and excludes patterns for things like the Maven Compiler plugin.  In other words, you are going to have to expend a huge amount of effort to bend Maven to your assumptions.</p>

<p>If you do this, you really won&#8217;t be using &#8220;Maven&#8221;.  You&#8217;ll be using your own interpretation of Maven, and once you go down this road, you are going to start having problems using standard tools designed for Maven.   In short, don&#8217;t do this.  Don&#8217;t try to bypass Maven&#8217;s approach to modularity with assemblies and profiles.  If you do, you are going to find yourself &#8220;swimming upstream&#8221;, and your first hint is going to be the size and complexity of your POM files.     I&#8217;ve certainly created some complex POMs in my time, but I only need to do this for projects that really require customization because they are doing something unique (see the POMs for the Maven book builds, they are large and extremely customized).</p>

<p>If you are creating web applications, EARs, and simple Java applications you shouldn&#8217;t have large POMs.   If you do, it is probably a sign that you have ventured too far &#8220;off the map&#8221;.   While you might be building your project with &#8220;Maven&#8221;, there is likely something wrong with your approach.   If you find yourself constantly challenging an assumption as basic as project modularity, then you need to either rethink using Maven entirely or rethink your project structure.</p>

<h3>Adopting Maven Means Adopting Modular Structure</h3>

<p>If you are going to adopt Maven, you must adopt a modular project structure.  If you don&#8217;t you will be fighting an uphill battle with Maven and the tools that have been designed to work with it.   You will be fighting not only with Maven, but you&#8217;ll be doing constant battle with your IDE and your repository manager.</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure-maven.png"><img src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ant-migrate-structure-maven.png" alt="" title="ant-migrate-structure-maven" width="512" height="548" class="aligncenter size-full wp-image-6123" /></a></p>

<p>If you are moving from Ant to Maven, do you yourself a favor.   Adopt a modular project structure.  Don&#8217;t approach Maven as a &#8220;toolbox&#8221; like Ant with tasks and targets.   Approach Maven as a framework with expectations and assumptions.  If you do this, you&#8217;ll have a much easier time adopting the tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/08/how-to-migrate-from-ant-to-maven-project-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benefits of a Repository Manager: Part III Continuous Build Deployment</title>
		<link>http://www.sonatype.com/people/2010/08/benefits-of-a-repository-manager-part-iii-continuous-build-deployment/</link>
		<comments>http://www.sonatype.com/people/2010/08/benefits-of-a-repository-manager-part-iii-continuous-build-deployment/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 13:46:30 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[builds]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[Hudson]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=5914</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/08/benefits-of-a-repository-manager-part-iii-continuous-build-deployment/' addthis:title='Benefits of a Repository Manager: Part III Continuous Build Deployment '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>In the previous post in this series I discussed three compelling ways in which a repository manager can benefit the development cycle. It proxies artifacts locally, it is optimized to store binary artifacts, and it facilitates a new level of collaboration and agility that isn&#8217;t possible when your SCM is only way for workgroups to [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/08/benefits-of-a-repository-manager-part-iii-continuous-build-deployment/' addthis:title='Benefits of a Repository Manager: Part III Continuous Build Deployment '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>In the previous post in this series I discussed three compelling ways in which a repository manager can benefit the development cycle.   It proxies artifacts locally, it is optimized to store binary artifacts, and it facilitates a new level of collaboration and agility that isn&#8217;t possible when your SCM is only way for workgroups to collaborate.   In this post, I&#8217;m going to talk about how a repository manager works in concert with a continuous integration server like Hudson or Bamboo.</p>

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

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ci-builds.png"><img class="aligncenter size-full wp-image-5915" title="ci-builds" src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ci-builds.png" alt="" width="337" height="147" /></a></p>

<p>First, the how, what, and when of a continuous integration server.  Continuous integration (CI) servers are an established fact of of modern development infrastructure.   It is a server which, for the most part, waits and watches.   It keeps a vigilant eye on your source control system and jumps into action every time it sees a code change.    When code changes, your CI system is usually configured to run the entire build, execute all of your unit and integration tests, and send out an email to every developer if it identifies a defect or a failed test.</p>

<p>It does this so that you will have an easier time identifying where a particular problem was introduced to the source code.   If John checks in some bad code, the CI system runs the build immediately, and about 30 minutes later, everyone in the group receives an email with the subject header &#8220;John just broke the build&#8221;.   It is a great way to identify errors, and it is also a great way to motivate developers to test locally before committing to a source control system as no one likes to be the reason for a build failure email.</p>

<p>Running a CI server is more than &#8220;just a good idea&#8221;.  Once your system reaches a certain level of complexity you can&#8217;t scale a system without commiting to continuous integration and testing.   If you don&#8217;t have continuous integration, you end up having to put all development on hold each time you want to perform a release.   If you don&#8217;t build, test, and deploy your system on a regular basis &#8211; if it isn&#8217;t something that is well rehearsed, integration becomes a time consuming nightmare of manual testing and builds that often leads to inconsistent builds.   This is especially true if your development effort spans multiple systems and multiple development workgroups.   You run a CI system because building, testing, and deploying your system should be automatic: it should be as trivial as pressing a button.</p>

<p>The concept of a CI server is only slightly more established than a repository manager, and very often you will see that an organization has identified the need for a CI server before they&#8217;ve identified the need for a repository manager.   If you are coding a complex system, there is a very good chance that you are already running a CI server.  The most popular servers out there are Hudson, Bamboo, and CruiseControl.   While the connection between CI servers and repository managers might not be immediately obvious, when used together they can introduce some new possibilities for the way you develop your systems.</p>

<h2>Continuous Publishing</h2>

<p>When you have a system to continuously build your code, you also have a system that can continuously publish SNAPSHOT artifacts to a repository manager to enable a more granular approach to development.   What do I mean by &#8220;a more granular approach to development&#8221;?  To answer that question, let&#8217;s take a look at a complex multi-module project using the example of the eCommerce group from the previous post in this series.</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ecom-multimod.png"><img class="aligncenter size-full wp-image-5918" title="ecom-multimod" src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ecom-multimod.png" alt="" width="434" height="569" /></a></p>

<p>Assume you have a new programmer starting tomorrow.   Instead of throwing him at the entire forty-thousand lines of code, you would like to be able to give that developer a small, easy to digest task.    You want this developer to add support for PayPal&#8217;s Adaptive Payments API in your eCommerce system.  That&#8217;s it.   You don&#8217;t want them to be distracted by the overwhelming scope of the project, and you certainly can&#8217;t afford for them to take a three month voyage through your project&#8217;s code before they start contributing to the effort.   Deadlines are tight, and you don&#8217;t have enough people on your team.   It is important that new hires start programming as soon as they walk in the door.</p>

<p>Without a repository manager hooked up to a continuous integration server, if you try to checkout just the ecom-paypal project, the build is going to fail because it will try to download dependencies from a repository manager.   In the case of the ecom-paypal project, assume that the dependency graph looks like this.</p>

<p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/08/ecom-multimod-dep.png"><img class="aligncenter size-full wp-image-5919" title="ecom-multimod-dep" src="http://www.sonatype.com/people/wp-content/uploads/2010/08/ecom-multimod-dep.png" alt="" width="448" height="191" /></a></p>

<p>When you have a repository manager and a continuous integration server, you can configure your continuous integration server to publish SNAPSHOT artifacts (in-progress SNAPSHOT binaries) to your repository manager.   This will allow you to just check out a single, isolated portion of a much larger multi-module project.</p>

<p>Without a repository manager, trying to build version 1.3-SNAPSHOT of ecom-paypal in isolation is going to generate errors because you are forced to checkout the entire codebase to build and install all of the dependencies in your local repository.   With a repository manager, SNAPSHOT artifacts are being continuously published because Hudson is checking you SCM every few minutes and building the latest code.   When you run the ecom-paypal module&#8217;s build in isolation, Maven is going to download the most recent SNAPSHOT.</p>

<p>Without a repository manager, your new developer is going to have to download the entire codebase and run a large time-consuming build.   With a repository manager you can work on specific components of a larger multi-module project.    This ability to divide and conquer your codebase comes in very handy when you need a consultant to take a look at a specific problem, or when you need to look at a coding problem in isolation.</p>

<p>When you continuously publish build artifacts to a repository manager, you move away from the single monolithic project build and toward a project layout and architecture that lends itself to modularization.</p>

<p>In tomorrow&#8217;s post: How a Repository Manager decouples deployments from source code, and what that means for developer operations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/08/benefits-of-a-repository-manager-part-iii-continuous-build-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roller Project Converts Build to Maven</title>
		<link>http://www.sonatype.com/people/2010/03/roller-project-converts-build-to-maven/</link>
		<comments>http://www.sonatype.com/people/2010/03/roller-project-converts-build-to-maven/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:53:06 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[IDE integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[m2eclipse]]></category>
		<category><![CDATA[Roller]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=4667</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/03/roller-project-converts-build-to-maven/' addthis:title='Roller Project Converts Build to Maven '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Sonatype has spent the last few years investing in the Maven ecosystem. We&#8217;ve created solid documentation, we&#8217;ve invested heavily in making sure that m2eclipse provides solid IDE integration, and we&#8217;re about to unleash even more tools that will make it even easier for developers to develop and share software. Here&#8217;s an excerpt from Dave Johnson&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/03/roller-project-converts-build-to-maven/' addthis:title='Roller Project Converts Build to Maven '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p><a href="http://www.sonatype.com/people/wp-content/uploads/2010/03/maven1.jpg"><img class="alignright size-medium wp-image-4670" title="maven" src="http://www.sonatype.com/people/wp-content/uploads/2010/03/maven1-300x61.jpg" alt="" width="300" height="61" /></a>Sonatype has spent the last few years investing in the Maven ecosystem. We&#8217;ve created solid documentation, we&#8217;ve invested heavily in making sure that m2eclipse provides solid IDE integration, and we&#8217;re about to unleash even more tools that will make it even easier for developers to develop and share software.   Here&#8217;s an excerpt from <a href="http://rollerweblogger.org/roller/entry/roller_built_with_maven">Dave Johnson&#8217;s entry</a> on converting the Roller project&#8217;s build to Maven:</p>

<blockquote>I was a Maven hater and resisted it for a long time but over the years Maven has gotten much better, it&#8217;s well supported in IDEs and as far as I can tell, Maven has replaced Ant as the de facto build system for Java projects. If you want new developers be able to easily build, debug and run your code via command or their favorite IDE then Maven is the way to go, and that&#8217;s especially true for open source projects like Roller.  That&#8217;s why I spent a couple of weekends learning Maven and converting Roller&#8217;s build process from Ant to Maven (ROL-1849). The process of conversion wasn&#8217;t too difficult.</blockquote>

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

<p>You can read more of <a href="http://rollerweblogger.org/roller/entry/roller_built_with_maven">Dave Johnson&#8217;s entry</a>, or you can watch this short video showing the ease with which you can now obtain and build Roller.</p>

<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="660" height="405" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/daN2H8VWI1k&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6&amp;hd=1&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="660" height="405" src="http://www.youtube.com/v/daN2H8VWI1k&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6&amp;hd=1&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/03/roller-project-converts-build-to-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven over Ant + Ivy: A Team Perspective by Les Hazlewood</title>
		<link>http://www.sonatype.com/people/2010/01/maven-over-ant-ivy-a-team-perspective-by-les-hazlewood/</link>
		<comments>http://www.sonatype.com/people/2010/01/maven-over-ant-ivy-a-team-perspective-by-les-hazlewood/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:03:29 +0000</pubDate>
		<dc:creator>Jason van Zyl</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ivy]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=3909</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/01/maven-over-ant-ivy-a-team-perspective-by-les-hazlewood/' addthis:title='Maven over Ant + Ivy: A Team Perspective by Les Hazlewood '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Les Hazlewood has an objective summary of why he eventually came around to deciding that Maven is a better overall solution then Ant + Ivy. This is an evolution in thought process that we, Sonatype, often see in enterprises and Les has two blog entries that illustrate this evolution perfectly. Maven 2 vs Ant+Ivy: Our [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2010/01/maven-over-ant-ivy-a-team-perspective-by-les-hazlewood/' addthis:title='Maven over Ant + Ivy: A Team Perspective by Les Hazlewood '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p><a href="http://www.sonatype.com/people/wp-content/uploads/2009/10/maven.png"><img src="http://www.sonatype.com/people/wp-content/uploads/2009/10/maven.png" alt="" title="maven" width="250" height="72" class="alignright size-full wp-image-3145" /></a></p>

<p><a href="http://www.leshazlewood.com">Les Hazlewood</a> has an objective summary of why he eventually came around to deciding that Maven is a better overall solution then Ant + Ivy. This is an evolution in thought process that we, <a href="http://www.sonatype.com">Sonatype</a>, often see in enterprises and Les has two blog entries that illustrate this evolution perfectly.</p>

<p><a href="http://www.leshazlewood.com/?p=44">Maven 2 vs Ant+Ivy: Our selection process</a>: This entry gives Les&#8217; original perspective on Maven and the process by which he originally decided to choose Ant + Ivy.</p>

<p><a href="http://www.leshazlewood.com/?p=55">Maven 2 vs Ant+Ivy: Revisited</a>: This entry gives Les&#8217; new perspective and why his enterprise team, and the Apache Shiro project, have chosen Maven.</p>

<blockquote>
  <p>I now firmly believe that Maven 2 is a better build and project management tool than Ant+Ivy. I was wrong.</p>
  
  <p>Yep, I said it. I’m man enough to admit when I’ve made mistakes and that I’ve learned from my experiences. And this is coming from the guy that wrote a (still popular) OnJava article for Ant in the enterprise.</p>
  
  <p>Overall, life with Maven is good. I’m glad that I was able to swallow my pride, really give it a chance, and in turn reap the benefits. I haven’t used Ant in over a year since switching, nor have I ever felt the need to go back.</p>
</blockquote>

<p>We hope this perspective helps potential enterprises save time when looking for a build and release infrastructure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2010/01/maven-over-ant-ivy-a-team-perspective-by-les-hazlewood/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenDocument Java API Project Switches from Ant to Maven</title>
		<link>http://www.sonatype.com/people/2009/07/opendocument-java-api-project-switches-from-ant-to-maven/</link>
		<comments>http://www.sonatype.com/people/2009/07/opendocument-java-api-project-switches-from-ant-to-maven/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 15:14:50 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=2639</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2009/07/opendocument-java-api-project-switches-from-ant-to-maven/' addthis:title='OpenDocument Java API Project Switches from Ant to Maven '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>ODFDOM, the OpenDocument Java API, has been released. You can read more about the project release here. From the site: &#8220;ODFDOM is an Apache 2 licensed Java library to easily create, access and manipulate ODF documents.&#8221; What&#8217;s interesting about this particular software release is the switch from Ant to Maven. Here&#8217;s the quote that caught [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2009/07/opendocument-java-api-project-switches-from-ant-to-maven/' addthis:title='OpenDocument Java API Project Switches from Ant to Maven '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>ODFDOM, the OpenDocument Java API, has been released.   You can read more about the project release <a href="http://blogs.sun.com/GullFOSS/entry/odfdom_0_7_new_release">here</a>.  From the site:
&#8220;ODFDOM is an Apache 2 licensed Java library to easily create, access and manipulate ODF documents.&#8221;   What&#8217;s interesting about this particular software release is the switch from Ant to Maven.   Here&#8217;s the quote that caught my attention.</p>

<blockquote>Last but not least, with the support by Benson Margulies, we were able to switch our build environment from ANT to Maven. By using Maven we made our dependencies declarative. We no longer add dependent JARs to our sources (e.g. the parser XercesImpl.jar), but are able to download them via Maven [Central] on demand. Following this idea of modularization, we were able to simplify the source structure of ODFDOM by moving our code-generation to a [new] project called relaxng2template.</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2009/07/opendocument-java-api-project-switches-from-ant-to-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercury &#8211; externalized dependencies</title>
		<link>http://www.sonatype.com/people/2008/10/mercury-externalized-dependencies/</link>
		<comments>http://www.sonatype.com/people/2008/10/mercury-externalized-dependencies/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 15:35:57 +0000</pubDate>
		<dc:creator>oleg</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[Mercury]]></category>

		<guid isPermaLink="false">http://blogs.sonatype.com/people/?p=1258</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2008/10/mercury-externalized-dependencies/' addthis:title='Mercury &#8211; externalized dependencies '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Inspiration In Mercury we made an attempt to bring some contemporary ideas into Maven, make Maven not a monolithic build system, but rather a lego-like construction set that allows users to create systems they need. One set of building blocks in particular &#8211; implementation of the idea that dependencies is a universal commodity, that exists [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.sonatype.com/people/2008/10/mercury-externalized-dependencies/' addthis:title='Mercury &#8211; externalized dependencies '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><h2>Inspiration</h2>

<p>In Mercury we made an attempt to bring some contemporary ideas into Maven, make Maven not a monolithic build system, but rather a lego-like construction set that allows users to create systems they need. One set of building blocks in particular &#8211; implementation of the idea that dependencies is a universal commodity, that exists outside of Maven world. And operation of resolving conflicts on those dependencies can apply to a broader range of dependencies, not just &lt;dependencies/&gt; tag in the POM file.</p>

<p>For example &#8211; it should be relatively easy to plug in an implementation to read OSGi bundle dependencies. Or read a .properties file with dependencies.</p>

<p>Or &#8211; my favorite &#8211; keep dependencies in a <a href="http://www.jboss.org/drools/" title="Drools home page">Drools</a>-backed DSL file. I will try to create this implementation after we integrate Maven POM dependency reader into Mercury.</p>

<p>How is it done:</p>

<ul>
<li>Dependency trees and manipulated by <strong>DependencyTreeBuilder</strong> object</li>
<li>DependencyTreeBuilder instance is created out of a collection of <strong>Repositories</strong> (to find Artifacts) and and instance of <strong>DependencyProcessor</strong>.</li>
<li>DependencyProcessor abstraction is that externalization component for reading/processing depedencies, making the builder independent of actual dependency information storage</li>
</ul>

<h2>Example code</h2>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">    DependencyTreeBuilder dtb
        <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DependencyTreeBuilder<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span>, reps, processor <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    MetadataTreeNode root
        <span style="color: #339933;">=</span> dtb.<span style="color: #006633;">buildTree</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> ArtifactBasicMetadata<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;org.apache.maven:maven-core:2.0.9&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">List</span> cp
        <span style="color: #339933;">=</span> dtb.<span style="color: #006633;">resolveConflicts</span><span style="color: #009900;">&#40;</span> ArtifactScopeEnum.<span style="color: #006633;">compile</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<p>This example demonstrates full dependency resolution cycle:</p>

<ul>
<li>full tree is created in <strong>root</strong> variable</li>
<li>compile classpath is stored in variable <strong>cp</strong>.</li>
</ul>

<p>The two initialization steps required:</p>

<ul>
<li>create a collection of repositories in <strong>reps</strong></li>
<li>get an instance of DependencyProcessor into <strong>processor</strong></li>
</ul>

<p>Also interesting &#8211; resulting classpath is a list of artifact metadata objects, not artifact binaries. So in order to actually bring the binaries to local machine, we&#8217;ll need one more call &#8211; to VirtualRepositoryReader, which I will describe it in a separate posting.</p>

<p>What&#8217;s important here is the fact that operation of fetching binaries from remote repositories is separated from building dependency tree as well as from resolving conflicts.  Which means that you can call all of those operations independently to construct a workflow you need for a particular application. All the metadata that was fetched in the process of creating dependency tree is cached by a <strong>RepositoryMetadataCache</strong> component, that complies with repository update policy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sonatype.com/people/2008/10/mercury-externalized-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

