<?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; Java</title>
	<atom:link href="http://www.jpeterson.com/category/software/java/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>Hello, Android</title>
		<link>http://www.jpeterson.com/2008/07/13/hello-android/</link>
		<comments>http://www.jpeterson.com/2008/07/13/hello-android/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 01:47:14 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/2008/07/13/hello-android/</guid>
		<description><![CDATA[So, July 11, 2008, came and went. What happened on July 11? The iPhone 3G came out.
But I don&#8217;t have an iPhone. The other big thing is that the Apple iPhone App Store opened. But I don&#8217;t have a Mac, so I can&#8217;t run the emulator or create my own apps for the emulator.
So, I [...]]]></description>
			<content:encoded><![CDATA[<p>So, July 11, 2008, came and went. What happened on July 11? The <a href="http://store.apple.com/us/browse/home/shop_iphone/family/iphone?mco=MTE2NTQ">iPhone 3G</a> came out.</p>
<p>But I don&#8217;t have an iPhone. The other big thing is that the Apple iPhone App Store opened. But I don&#8217;t have a Mac, so I can&#8217;t run the emulator or create my own apps for the emulator.</p>
<p>So, I celebrated by creating my first <a href="http://code.google.com/android/">Android</a> app.</p>
<p><img src="http://www.jpeterson.com/wordpress/wp-content/uploads/2008/07/helloandroid.png" alt="Hello, Android" /></p>
<p>This is the &#8220;Hello, World&#8221; version of an Android app running in the emulator. It was very easy to make. What made it easier for me is that Android apps are written in <a href="http://www.java.com/en/">Java</a>. (I am a Java developer by day.) The &#8220;<a href="http://code.google.com/android/intro/index.html">Getting Started</a>&#8221; tutorial even shows you how to use <a href="http://www.eclipse.org/">Eclipse</a>.</p>
<p>I have only created the sample app so far, but it looks pretty easy for a Java developer to write an &#8220;<a href="http://code.google.com/android/intro/anatomy.html">Activity</a>&#8220;. But, of coarse, the apps currently can only run in the emulator. But the emulator can be integrated very easily into Eclipse.</p>
<p>Though, it is not like having real hardware like the Apple iPhone. <img src='http://www.jpeterson.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2008/07/13/hello-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X10 API source code</title>
		<link>http://www.jpeterson.com/2007/05/29/x10-api-source-code/</link>
		<comments>http://www.jpeterson.com/2007/05/29/x10-api-source-code/#comments</comments>
		<pubDate>Tue, 29 May 2007 13:15:30 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/2007/05/29/x10-api-source-code/</guid>
		<description><![CDATA[Many years ago, I created an API for interacting with the home automation technology called X10. The API interfaced with power line modules via a serial interface. I haven&#8217;t done anything with the X10 home automation API that I created a couple years ago. I have gotten a bit sidetracked by fatherhood.  
You can [...]]]></description>
			<content:encoded><![CDATA[<p>Many years ago, I created an API for interacting with the home automation technology called X10. The API interfaced with power line modules via a serial interface. I haven&#8217;t done anything with the X10 home automation API that I created a couple years ago. I have gotten a bit sidetracked by <a href="http://www.jpeterson.com/2007/03/25/first-post/">fatherhood</a>. <img src='http://www.jpeterson.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>You can find the source code <a href="http://www.jpeterson.com/x10/x10.zip">here</a>. If you do try to compile this, you may get an error about a missing class. This isn&#8217;t important; you can whack away the reference and compile again. (Not very helpful, I know, but if I get more time, I may update this with some more information.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2007/05/29/x10-api-source-code/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

