<?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>indiWiz.com &#187; maven</title>
	<atom:link href="http://indiwiz.com/tag/maven/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Sun, 29 Apr 2012 15:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Maven Profiles</title>
		<link>http://indiwiz.com/2009/09/01/maven-profiles/</link>
		<comments>http://indiwiz.com/2009/09/01/maven-profiles/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:16:54 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=453</guid>
		<description><![CDATA[Thanks to Arun Jeganath for making me understand Maven Profiles. Often we are forced to specify different build parameters in different environments. In the ages of Make, these parameters used to be specified as environment variables. In the world of Maven, we have profiles. Profiles: Introduction A sample profile information: Quick learning from the above [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><i>Thanks to <a href="http://www.linkedin.com/in/arunjeganath">Arun Jeganath</a> for making me understand Maven Profiles.</i></p>
<p>Often we are forced to specify different build parameters in different environments. In the ages of <em>Make</em>, these parameters used to be specified as environment variables. In the world of Maven, we have profiles.</p>
<h4>Profiles: Introduction</h4>
<p>A sample profile information:</p>
<pre class="brush: xml; title: ; notranslate">
  &lt;profiles&gt;

    &lt;!-- DEV Profile (Default) --&gt;
    &lt;profile&gt;
      &lt;id&gt;dev-profile&lt;/id&gt;
      &lt;activation&gt;
        &lt;property&gt;
          &lt;name&gt;env&lt;/name&gt;
          &lt;value&gt;dev&lt;/value&gt;
        &lt;/property&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt; &lt;!-- Note this --&gt;
      &lt;/activation&gt;
      &lt;!-- Liferay Home in DEV --&gt;
      &lt;properties&gt;
        &lt;liferay-home&gt;${user.home}/apps/liferay-portal-tomcat-6.0-5.1.2&lt;/liferay-home&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;

    &lt;!-- TEST Profile --&gt;
    &lt;profile&gt;
      &lt;id&gt;test-profile&lt;/id&gt;
      &lt;activation&gt;
        &lt;property&gt;
          &lt;name&gt;env&lt;/name&gt;
          &lt;value&gt;test&lt;/value&gt;
        &lt;/property&gt;
      &lt;/activation&gt;
      &lt;!-- Liferay Home in TEST --&gt;
      &lt;properties&gt;
        &lt;liferay-home&gt;/opt/apps/liferay-portal-tomcat-6.0-5.1.2&lt;/liferay-home&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
</pre>
<p>Quick learning from the above example:</p>
<ul>
<li>There can be number of profiles defined.</li>
<li>A profile can be marked as <em>&lt;activeByDefault&gt;</em>. This will enforce the configuration defined in the activated profile to take effect during build.</li>
<li>To enable a specific profile during build, the value defined in XPath <em>/profiles/profile/activation/property</em> needs to be passed the Maven as System Property (in our case: <strong>-Denv=test</strong>).</li>
<li>The property defined in the profile (<em>liferay-home</em>) can be referenced elsewhere in the <em>pom.xml</em> as <em>${liferay-home}</em>.</li>
</ul>
<h4>Placing profile information</h4>
<p>Profile information is generally placed in:</p>
<ol>
<li>In the project POM itself.</li>
<li>Inside <em>{user.home}/.m2/settings.xml</em>.</li>
</ol>
<p>In the first case (in this particular example), the deployment information is placed in the project&#8217;s POM. This, some might feel improper because the module/project build has hardcoded environment dependencies which might not work in other systems. The second option externalizes the platform specific build information. But a new developer checking out the project will not be aware of this external dependency causing his build to fail. Both these problems might be addressed using documentation: some projects have README and BUILD files explaining environment setup for build.</p>
<p>As we saw, both methods have advantages and disadvantages. Choose the method appropriate to your situation.</p>
<h4>Parameters that can be overridden in profiles</h4>
<p><em>Note</em>: This list is shamelessly copied from the <a href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html">official Maven profiles guide</a>. Refer to this guide for detailed information.</p>
<ul>
<li><tt>&lt;repositories&gt;</tt></li>
<li><tt>&lt;pluginRepositories&gt;</tt></li>
<li><tt>&lt;dependencies&gt;</tt></li>
<li><tt>&lt;plugins&gt;</tt></li>
<li><tt>&lt;properties&gt;</tt> (not actually available in the main POM, but used behind the scenes)</li>
<li><tt>&lt;modules&gt;</tt></li>
<li><tt>&lt;reporting&gt;</tt></li>
<li><tt>&lt;dependencyManagement&gt;</tt></li>
<li><tt>&lt;distributionManagement&gt;</tt></li>
<li>a subset of the <tt>&lt;build&gt;</tt> element, which consists of:
<ul>
<li><tt>&lt;defaultGoal&gt;</tt></li>
<li><tt>&lt;resources&gt;</tt></li>
<li><tt>&lt;testResources&gt;</tt></li>
<li><tt>&lt;finalName&gt;</tt></li>
</ul>
<div class="shr-publisher-453"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/09/01/maven-profiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven 2.2.0 released</title>
		<link>http://indiwiz.com/2009/07/31/maven-2-2-0-released/</link>
		<comments>http://indiwiz.com/2009/07/31/maven-2-2-0-released/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 08:26:46 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=407</guid>
		<description><![CDATA[I was surprised to find a major new release of Maven. It seems that Maven 2.1.0 suffered from a major bug due to which releases could not be done. A quick overview of this bug and other feature improvements are discussed in this blog.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I was surprised to find a major new release of <a href="http://maven.apache.org/">Maven</a>. It seems that Maven 2.1.0 suffered from a major bug due to which releases could not be done. A quick overview of this bug and other feature improvements are <a href="http://www.sonatype.com/people/2009/06/maven-220-released/">discussed in this blog</a>.</p>
<div class="shr-publisher-407"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/07/31/maven-2-2-0-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maven managed projects: Generating dependency graph</title>
		<link>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/</link>
		<comments>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 01:38:18 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=342</guid>
		<description><![CDATA[When using Maven from commandline, use this command: If you are using Netbeans 6.7, you can generate a much more visual graph: For bringing up this graph, just right click on the project and select Show Dependency Graph. The screenshots above show the dependency graph for my project WizTools.org RESTClient.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>When using Maven from commandline, use this command:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3649142396/" title="Maven Dependency Graph by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3552/3649142396_de89338f89.jpg" width="480" height="500" alt="Maven Dependency Graph" /></a></p>
<p>If you are using Netbeans 6.7, you can generate a much more visual graph:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3649142964/" title="Netbeans Maven Dependency Graph by subWiz, on Flickr"><img src="http://farm3.static.flickr.com/2442/3649142964_43a9893c18.jpg" width="500" height="303" alt="Netbeans Maven Dependency Graph" /></a></p>
<p>For bringing up this graph, just right click on the project and select <em>Show Dependency Graph</em>.</p>
<p>The screenshots above show the dependency graph for my project <a href="http://rest-client.googlecode.com/">WizTools.org RESTClient</a>.</p>
<div class="shr-publisher-342"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallel download of artifacts in Maven 2.1.0</title>
		<link>http://indiwiz.com/2009/04/07/parallel-download-of-artifacts-in-maven-210/</link>
		<comments>http://indiwiz.com/2009/04/07/parallel-download-of-artifacts-in-maven-210/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 23:42:30 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://indiwiz.com/2009/04/07/parallel-download-of-artifacts-in-maven-210/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a href="http://www.flickr.com/photos/subwiz/3419782894/" title="Maven 2.1.0 Parallel Download by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3630/3419782894_3edc765910.jpg" width="500" height="373" alt="Maven 2.1.0 Parallel Download" /></a></p>
<div class="shr-publisher-236"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/04/07/parallel-download-of-artifacts-in-maven-210/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven 2.1.0 Released</title>
		<link>http://indiwiz.com/2009/03/26/maven-210-released/</link>
		<comments>http://indiwiz.com/2009/03/26/maven-210-released/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 09:42:46 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=231</guid>
		<description><![CDATA[My favorite project and build management tool, Maven, has been updated. View release notes for the list of bug fixes and feature improvements.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>My favorite project and build management tool, <a href="http://maven.apache.org/">Maven</a>, has been updated. View <a href="http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10500&amp;styleName=Html&amp;version=14587">release notes</a> for the list of bug fixes and feature improvements.</p>
<div class="shr-publisher-231"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/03/26/maven-210-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

