<?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>Jesse Peterson &#187; development</title>
	<atom:link href="http://www.jpeterson.com/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jpeterson.com</link>
	<description>Personal ramblings of a computer geek in Iowa</description>
	<lastBuildDate>Thu, 26 Jan 2012 04:16:38 +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>Using a Maven profile to run a test program</title>
		<link>http://www.jpeterson.com/2009/08/25/using-a-maven-profile-to-run-a-test-program/</link>
		<comments>http://www.jpeterson.com/2009/08/25/using-a-maven-profile-to-run-a-test-program/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 03:19:19 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/?p=184</guid>
		<description><![CDATA[This is a new (to me) trick for my programming toolbox. I discovered (copied) it from the Apache CXF project. (I don&#8217;t know if they originated it or not.) Basically, you can use a Maven profile configuration in your pom.xml to easily run a test program in your project that has a public static void [...]]]></description>
			<content:encoded><![CDATA[<p>This is a new (to me) trick for my programming toolbox. I discovered (copied) it from the <a href="http://cxf.apache.org/">Apache CXF</a> project. (I don&#8217;t know if they originated it or not.) Basically, you can use a <a href="http://maven.apache.org/">Maven</a> profile configuration in your pom.xml to easily run a test program in your project that has a <code>public static void main(String[] args)</code> method. I discovered this technique reading the <a href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/README.txt?view=co">README.txt</a> of the Apache CXF sample &#8220;<code>java_first_jaxws</code>&#8220;. Here is what the Maven command looks like:</p>
<p><code>mvn -Pserver</code></p>
<p>Here is what the profile configuration in the pom.xml looks like:</p>
<pre>...
&lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;server&lt;/id&gt;
    &lt;build&gt;
      &lt;defaultGoal&gt;test&lt;/defaultGoal&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;test&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;java&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;mainClass&gt;demo.hw.server.Server&lt;/mainClass&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
...
&lt;/profiles&gt;
...</pre>
<p>When the &#8220;<code>mvn -Pserver</code>&#8221; command is executed, the <code>exec-maven-plugin</code> will run the <code>demo.hw.server.Server</code> class. The <code>id</code> identifies the profile id used in the mvn command after the &#8220;<code>-p</code>&#8220;. The <code>mainClass</code> element defines the class with the main method to execute. The <a href="http://mojo.codehaus.org/exec-maven-plugin/"><code>exec-maven-plugin</code></a> does all of the hard work. One of the benefits of this technique is the standard Maven classpath for the project defined in the pom to build and unit test your software is used to run the <code>mainClass</code>. This comes in quite handy if your program uses many jar files. I used to use a Windows batch file (copied from the <a href="http://tomcat.apache.org/">Tomcat</a> startup script <a href="http://svn.apache.org/repos/asf/tomcat/trunk/bin/catalina.bat"><code>catalina.bat</code></a>) to run little test programs. This Maven profile technique is much easier to use for me, since I use Maven for most all of my Java development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2009/08/25/using-a-maven-profile-to-run-a-test-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code reviews in Google Code</title>
		<link>http://www.jpeterson.com/2008/12/03/code-reviews-in-google-code/</link>
		<comments>http://www.jpeterson.com/2008/12/03/code-reviews-in-google-code/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 02:24:48 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/2008/12/03/code-reviews-in-google-code/</guid>
		<description><![CDATA[So I just released a new version of &#8220;littles3&#8220;, a project hosted at Google Code. I tried out the &#8220;Issue&#8221; feature; pretty neat. But what I really found cool was the &#8220;code review&#8221; features in the source code management. For instance, the source file that was changed in my latest release was to FileS3ObjectDao. I [...]]]></description>
			<content:encoded><![CDATA[<p>So I just <a href="http://www.jpeterson.com/2008/12/02/littles3-version-220-released/">released a new version</a> of &#8220;<a href="http://littles3.googlecode.com/">littles3</a>&#8220;, a project <a href="http://code.google.com/hosting/">hosted at Google Code</a>. I <a href="http://code.google.com/p/littles3/issues/detail?id=1&amp;can=1">tried out</a> the &#8220;Issue&#8221; feature; pretty neat. But what I really found cool was the &#8220;code review&#8221; features in the source code management. For instance, the source file that was changed in my latest release was to FileS3ObjectDao. I was able to have a <a href="http://code.google.com/p/littles3/source/diff?spec=svn37&amp;r=37&amp;format=side&amp;path=/trunk/modules/filesystem/src/main/java/com/jpeterson/littles3/dao/filesystem/FileS3ObjectDao.java">diff from r21 (the old version) and r37</a> (the new version). It even let me <a href="http://code.google.com/p/littles3/source/diff?spec=svn37&amp;r=37&amp;format=side&amp;path=/trunk/modules/filesystem/src/main/java/com/jpeterson/littles3/dao/filesystem/FileS3ObjectDao.java">comment right within the diff</a>, in either the old or new version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2008/12/03/code-reviews-in-google-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

