<?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>Ian Brandt</title>
	<atom:link href="http://ianbrandt.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ianbrandt.com</link>
	<description>On software and such</description>
	<lastBuildDate>Mon, 17 Oct 2011 05:35:03 +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>ECJ 3.7.1 Published to Maven Central</title>
		<link>http://ianbrandt.com/2011/10/10/ecj-3-7-1-published-to-maven-central/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ecj-3-7-1-published-to-maven-central</link>
		<comments>http://ianbrandt.com/2011/10/10/ecj-3-7-1-published-to-maven-central/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 13:39:06 +0000</pubDate>
		<dc:creator>Ian Brandt</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://ianbrandt.com/?p=17</guid>
		<description><![CDATA[In order to assist the Apache Tomcat project I&#8217;ve recently taken to publishing versions of the Eclipse JDT Core Batch Compiler (ECJ) to the Maven Central repository.  Tomcat is presently built with Ant, not Maven, and on occasion it&#8217;s published POM file for the Jasper JSP parser refers to ECJ dependencies that are not available in Maven Central.  Today I&#8217;ve uploaded [...]]]></description>
			<content:encoded><![CDATA[<p>In order to assist the <a title="Apache Tomcat" href="http://tomcat.apache.org/">Apache Tomcat</a> project I&#8217;ve recently taken to publishing versions of the <a title="The Eclipse JDT Core Component" href="http://www.eclipse.org/jdt/core/">Eclipse JDT Core Batch Compiler</a> (ECJ) to the <a title="Introduction to Repositories" href="http://maven.apache.org/guides/introduction/introduction-to-repositories.html">Maven Central repository</a>.  Tomcat is presently built with <a title="Apache Ant" href="http://ant.apache.org/">Ant</a>, not <a title="Apache Maven" href="http://maven.apache.org/">Maven</a>, and on occasion it&#8217;s published POM file for the Jasper JSP parser refers to ECJ dependencies that are not available in Maven Central.  Today I&#8217;ve uploaded <a title="Maven Central - Artifact details for org.eclipse.jdt.core.compiler:ecj:3.7.1" href="http://search.maven.org/#artifactdetails%7Corg.eclipse.jdt.core.compiler%7Cecj%7C3.7.1%7Cjar">ECJ 3.7.1 (R-3.7.1-201109091335)</a>.</p>
<p>The process is well documented in <a title="Uploading 3rd-party Artifacts to Maven Central" href="https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+Maven+Central">Uploading 3rd-party Artifacts to Maven Central</a>, but hopefully the following example makes it that much more accessible to others.  I&#8217;ll assume you have Maven installed and are familiar with its basic usage.</p>
<ol>
<li>First one needs an OpenPGP key, with the public half published to an open key server.  I found the <a title="Ubuntu GnuPrivacyGuardHowto" href="https://help.ubuntu.com/community/GnuPrivacyGuardHowto">Ubuntu GnuPrivacyGuardHowto</a> very helpful in this regard, specifically sections <a title="GnuPrivacyGuardHowto - Generating an OpenPGP Key" href="https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Generating_an_OpenPGP_Key">2</a> &amp; <a title="GnuPrivacyGuardHowto - Uploading the Key to an Ubuntu Keyserver" href="https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Uploading_the_key_to_Ubuntu_keyserver">3</a>.  You&#8217;ll find <a title="Ian Brandt's OpenPGP public key" href="http://keyserver.ubuntu.com:11371/pks/lookup?search=Ian+Brandt&amp;op=index">my public key</a> on Ubuntu&#8217;s key server.</li>
<li>We&#8217;ll need some directories to work with:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>Development<span style="color: #000000; font-weight: bold;">/</span>ecj<span style="color: #000000; font-weight: bold;">/</span>3.7.1<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>java
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Development<span style="color: #000000; font-weight: bold;">/</span>ecj<span style="color: #000000; font-weight: bold;">/</span>3.7.1<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> target<span style="color: #000000; font-weight: bold;">/</span>classes</pre></td></tr></table></div>

</li>
<li>We pull down the ECJ <a title="Eclipse JDT Core Batch Compiler downloads for version 3.7.1" href="http://download.eclipse.org/eclipse/downloads/drops/R-3.7.1-201109091335/index.php#JDTCORE">source and binaries from Eclipse</a>.  (Finding the drops for a given version generally entails fishing around <a href="http://download.eclipse.org/eclipse/downloads/">http://download.eclipse.org/eclipse/downloads/</a>.)</li>
<li>Next we extract the downloads to the <a title="Introduction to the Standard Directory Layout" href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">directories Maven expects</a>:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>
jar <span style="color: #660033;">-xvf</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>ecjsrc-3.7.1.jar org
<span style="color: #7a0874; font-weight: bold;">cd</span> - ; <span style="color: #7a0874; font-weight: bold;">cd</span> target<span style="color: #000000; font-weight: bold;">/</span>classes
jar <span style="color: #660033;">-xvf</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>ecj-3.7.1.jar org
<span style="color: #7a0874; font-weight: bold;">cd</span> -</pre></td></tr></table></div>

</li>
<li>Borrowing from those of prior versions we craft a <a title="Maven Central Sync Requirements" href="https://docs.sonatype.org/display/Repository/Central+Sync+Requirements">suitable POM</a> at the root of our working directory in a file named <a href="http://search.maven.org/remotecontent?filepath=org/eclipse/jdt/core/compiler/ecj/3.7.1/ecj-3.7.1.pom">pom.xml</a>.</li>
<li>We create the artifact bundle with Maven:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">mvn <span style="color: #7a0874; font-weight: bold;">source</span>:jar javadoc:jar package gpg:sign repository:bundle-create</pre></td></tr></table></div>

<p>Maven prompts for our OpenPGP private key&#8217;s password from step #1:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[INFO] --- maven-gpg-plugin:1.3:sign (default-cli) @ ecj ---
GPG Passphrase: ************************</pre></div></div>

<p>Note that the Java .class files will not be recreated because we extracted the binaries as they were built by Eclipse.  This avoids any Java compiler version or target issues:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ecj ---
[INFO] Nothing to compile - all classes are up to date</pre></div></div>

<p>We&#8217;ll be prompted whether to exclude any files from the bundle, but we want them all so just enter &#8217;0&#8242;:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0.) Done
1.) ecj-3.7.1.jar
2.) ecj-3.7.1.jar.asc
3.) ecj-3.7.1.pom.asc
4.) ecj-3.7.1-javadoc.jar
5.) ecj-3.7.1-sources.jar
6.) ecj-3.7.1-javadoc.jar.asc
7.) ecj-3.7.1-sources.jar.asc
&nbsp;
Please select the number(s) for any files you wish to exclude, or '0' when you're done.
Separate the numbers for multiple files with a comma (',').
&nbsp;
Selection:
0
[INFO] Building jar: /Users/ibrandt/Development/ecj/3.7.1/target/ecj-3.7.1-bundle.jar</pre></div></div>

</li>
<li>Now all that&#8217;s left to do is upload the bundle archive to <a title="Sonatype Nexus Maven Repository Manager" href="http://oss.sonatype.org">https://oss.sonatype.org</a> per the aforementioned <a title="Uploading 3rd-party Artifacts to Maven Central" href="https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+Maven+Central">guide</a>.</li>
</ol>
<p>For those wishing to see Eclipse artifacts regularly published to a Maven repository see <a title="Eclipsepedia - Maven" href="http://wiki.eclipse.org/Maven">http://wiki.eclipse.org/Maven</a>, and place your votes here: <a title="Bug 283745 - Provide Maven repositories of stuff built at Eclipse" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=283745">https://bugs.eclipse.org/bugs/show_bug.cgi?id=283745</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ianbrandt.com/2011/10/10/ecj-3-7-1-published-to-maven-central/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back in Black</title>
		<link>http://ianbrandt.com/2011/09/28/back-in-black/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=back-in-black</link>
		<comments>http://ianbrandt.com/2011/09/28/back-in-black/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 17:44:35 +0000</pubDate>
		<dc:creator>Ian Brandt</dc:creator>
				<category><![CDATA[My Blog]]></category>

		<guid isPermaLink="false">http://ianbrandt.com/?p=6</guid>
		<description><![CDATA[After a 4 year hiatus my blog is back.   Stay tuned for news and thoughts related to my passion for creating software.]]></description>
			<content:encoded><![CDATA[<p>After a 4 year hiatus my blog is back.   Stay tuned for news and thoughts related to my passion for creating software.</p>
]]></content:encoded>
			<wfw:commentRss>http://ianbrandt.com/2011/09/28/back-in-black/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

