<?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>Mirko Stocker&#039;s Blog &#187; maven</title>
	<atom:link href="http://misto.ch/tag/maven/feed/" rel="self" type="application/rss+xml" />
	<link>http://misto.ch</link>
	<description></description>
	<lastBuildDate>Fri, 04 May 2012 18:00:25 +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>Building Eclipse Plug-ins Written in Scala with Maven/Tycho</title>
		<link>http://misto.ch/eclipse-plugins-scala-maventycho/</link>
		<comments>http://misto.ch/eclipse-plugins-scala-maventycho/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:40:04 +0000</pubDate>
		<dc:creator>Mirko Stocker</dc:creator>
				<category><![CDATA[InfoQ]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://misto.ch/?p=140</guid>
		<description><![CDATA[The Scala Refactoring project currently uses a rather crude hand-written ant build file; it compiles and runs tests. What it doesn&#8217;t do is creating a proper OSGi bundle, which I need if I want to do proper releases and integrate it into the Scala Eclipse IDE. Most of my colleagues are using PDE build, but [...]]]></description>
			<content:encoded><![CDATA[<p>The Scala Refactoring project currently uses a rather crude hand-written ant build file; it compiles and runs tests. What it doesn&#8217;t do is creating a proper OSGi bundle, which I need if I want to do proper releases and integrate it into the Scala Eclipse IDE. Most of my colleagues are using PDE build, but from what I&#8217;ve heard, <a href="http://www.eclipse.org/buckminster/">Buckminster</a> or <a href="http://tycho.sonatype.org/">Maven/Tycho</a> are the way to go.</p>
<p>Buchminster looks rather complex to me, so I went with Maven, even though I had no prior experience with it. Now, a few hours later, I have a <em>Hello World</em> plug-in written in Scala and a bunch of poms that build everything I want, even an update site! </p>
<p>Tycho needs Maven 3, which hasn&#8217;t been released yet, so I downloaded the latest <a href="http://maven.apache.org/download.html">alpha build</a> and created an alias that pointed to the mvn binary.</p>
<p>I started with <a href="http://mattiasholmqvist.se/2010/02/building-with-tycho-part-1-osgi-bundles/">Mattias Holmqvist&#8217;s Blog</a> where he explains how to create the initial Maven configuration and an OSGi bundle in Eclipse (I created a Hello World Plug-in Project). Now, we don&#8217;t want to have a Java plug-in but one written in Scala, so I added the Scala Nature to the project and re-wrote the two generated files in Scala.</p>
<p>To add Scala functionality to my pom, I followed the <a href="http://code.google.com/p/esmi/wiki/CreatingScalaMavenProjectsInEclipse">Eclipse Scala Maven Integration wiki</a>. I also had to add the Scala Eclipse Plug-in nightly build update site to my list of repositories so Maven could resolve the <em>scala.library</em> dependency the project has. </p>
<pre class="brush: xml; title: ; notranslate">    &lt;repository&gt;
       &lt;id&gt;scala eclipse nightly&lt;/id&gt;
       &lt;layout&gt;p2&lt;/layout&gt;
       &lt;url&gt;http://download.scala-ide.org/scala-eclipse-toolchain-osgi-2.9.1.final/&lt;/url&gt;
    &lt;/repository&gt;
</pre>
<p>Because I apparently didn&#8217;t follow Maven&#8217;s source layout, I had to explicitly specify the source directory via:
<pre class="brush: xml; title: ; notranslate">&lt;sourceDirectory&gt;${basedir}/src&lt;/sourceDirectory&gt;</pre>
<p>Adding the update site and feature projects was a peace of cake when following <a href="http://tycho.sonatype.org/how-to-create-a-new-osgi-bundle.html">this tutorial</a> (scroll to <em>Creating an Update Site / P2 repository</em>) from the Tycho project.</p>
<p>I&#8217;ve put the whole project on <a href="http://github.com/misto/Scala-Hello-World-Plug-in">GitHub</a> so you can try it yourself. And remember, this is my first day with Maven, so if I could make the poms even smaller or more idiomatic, please tell me. Or even better, just fork my code!</p>
<p>Next I&#8217;m going to find out how to run unit tests and how the integration in Hudson works, and then I can migrate the Scala Refactoring project and delete a build.xml file.</p>
<p><strong>Update April 2012:</strong> I&#8217;ve updated the <a href="https://github.com/misto/Scala-Hello-World-Plug-in">sample repository</a> to the latest versions of Scala, Eclipse and Maven-Tycho.</p>
<div class="plus-one-wrap"><g:plusone href="http://misto.ch/eclipse-plugins-scala-maventycho/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://misto.ch/eclipse-plugins-scala-maventycho/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

