<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Andreas Höhmann&#039;s Weblog &#187; Maven</title>
	<atom:link href="http://ahoehma.wordpress.com/category/softwareentwicklung/java/maven/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahoehma.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Nov 2009 15:53:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ahoehma.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6b74f500a29ea048aa3d7a14adc1a24f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Andreas Höhmann&#039;s Weblog &#187; Maven</title>
		<link>http://ahoehma.wordpress.com</link>
	</image>
			<item>
		<title>Concept to handle minimal and maximal tests in a maven project</title>
		<link>http://ahoehma.wordpress.com/2009/11/26/concept-to-handle-minimal-and-maximal-tests-in-a-maven-project/</link>
		<comments>http://ahoehma.wordpress.com/2009/11/26/concept-to-handle-minimal-and-maximal-tests-in-a-maven-project/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 13:03:29 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[Surefire]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=496</guid>
		<description><![CDATA[In real world applications we have all too often external dependencies in test cases. Sometimes theses third party are not always available (i.e. remote webservices).
For continuous integration I want check a minimal set of tests but for my local development i want check a maximal set of tests. I want run my tests on command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=496&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In real world applications we have all too often external dependencies in test cases. Sometimes theses third party are not always available (i.e. remote webservices).</p>
<p>For continuous integration I want check a minimal set of tests but for my local development i want check a maximal set of tests. I want run my tests on command line (via <a href="http://maven.apache.org/" target="_blank">maven</a>) and in eclipse (via <a href="http://testng.org/doc/eclipse.html" target="_blank">testng-plugin</a>).</p>
<p>Here is my idea to do that &#8230;</p>
<p>My project super pom defines 2 profiles:</p>
<ul>
<li>test-min
<ol>
<li> active by default</li>
<li>exclude testng groups (online-tests, thirdparty-tests,&#8230;)</li>
</ol>
</li>
<li>test-max
<ol>
<li>run a defined testng suite</li>
<li>the suite defines a maximal set of test (all testng groups)</li>
</ol>
</li>
</ul>
<pre class="brush: xml;">
&lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;test-min&lt;/id&gt;
    &lt;activation&gt;
      &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
    &lt;/activation&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
          &lt;inherited&gt;true&lt;/inherited&gt;
          &lt;configuration&gt;
            &lt;excludedGroups&gt;${excludedTestGroups}&lt;/excludedGroups&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
  &lt;profile&gt;
    &lt;id&gt;test-max&lt;/id&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
          &lt;inherited&gt;true&lt;/inherited&gt;
          &lt;configuration&gt;
            &lt;suiteXmlFiles&gt;
              ${basedir}/src/test/resources/Testsuite.xml
            &lt;/suiteXmlFiles&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
&lt;/profiles&gt;
&lt;properties&gt;
  &lt;excludedTestGroups&gt;online,integration,thirdparty&lt;/excludedTestGroups&gt;
&lt;/properties&gt;
</pre>
<p>Each subproject must define a testng <strong>src/test/resources/Testsuite.xml</strong>:</p>
<pre class="brush: xml;">
&lt;!DOCTYPE suite SYSTEM &quot;http://testng.org/testng-1.0.dtd&quot;&gt;
&lt;suite name=&quot;TestSuite for Foobar&quot;&gt;
  &lt;test name=&quot;Online Tests&quot;&gt;
    &lt;packages&gt;
      &lt;package name=&quot;de.foobar.*&quot; /&gt;
    &lt;/packages&gt;
    &lt;groups&gt;
      &lt;run&gt;
        &lt;include name=&quot;online&quot; /&gt;
      &lt;/run&gt;
    &lt;/groups&gt;
  &lt;/test&gt;
  &lt;test name=&quot;Integration Tests&quot;&gt;
    &lt;packages&gt;
      &lt;package name=&quot;de.foobar.*&quot; /&gt;
    &lt;/packages&gt;
    &lt;groups&gt;
      &lt;run&gt;
        &lt;include name=&quot;integration&quot; /&gt;
      &lt;/run&gt;
    &lt;/groups&gt;
  &lt;/test&gt;
  &lt;test name=&quot;Thirdparty Tests&quot;&gt;
    &lt;packages&gt;
      &lt;package name=&quot;de.foobar.*&quot; /&gt;
    &lt;/packages&gt;
    &lt;groups&gt;
      &lt;run&gt;
        &lt;include name=&quot;thirdparty&quot; /&gt;
      &lt;/run&gt;
    &lt;/groups&gt;
  &lt;/test&gt;
  &lt;!-- Each project can define MORE groups: i.e. &quot;interactive&quot; --&gt;
  &lt;test name=&quot;Other Tests&quot;&gt;
    &lt;packages&gt;
      &lt;package name=&quot;de.foobar.*&quot; /&gt;
    &lt;/packages&gt;
    &lt;groups&gt;
      &lt;run&gt;
        &lt;exclude name=&quot;online&quot; /&gt;
        &lt;exclude name=&quot;integration&quot; /&gt;
        &lt;exclude name=&quot;thirdparty&quot; /&gt;
        &lt;!-- Each project can define MORE groups: i.e. &quot;interactive&quot; --&gt;
      &lt;/run&gt;
    &lt;/groups&gt;
  &lt;/test&gt;
&lt;/suite&gt;
</pre>
<p>If the sub project defines more exclude groups (i.e. a additional &#8220;interactive&#8221; group) then the pom must overwrite the excludedTestGroups property:</p>
<pre class="brush: xml;">
&lt;properties&gt;
  &lt;excludedTestGroups&gt;online,integration,thirdparty,interactive&lt;/excludedTestGroups&gt;
&lt;/properties&gt;
</pre>
<p>To check the correct configuration of the two profiles we can use <strong>help:effective-pom</strong>:</p>
<p><code>mvn -Ptest-min help:effective-pom | less</code></p>
<pre class="brush: xml;">
&lt;plugin&gt;
  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;excludedGroups&gt;online,integration,thirdparty,interactive&lt;/excludedGroups&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;
</pre>
<p><code>mvn -Ptest-max help:effective-pom | less</code></p>
<pre class="brush: xml;">
&lt;plugin&gt;
  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
  &lt;configuration&gt;
    &lt;suiteXmlFiles&gt;
      &lt;suiteXmlFile&gt;d:\foobar\src/test/resources/Testsuite.xml&lt;/suiteXmlFile&gt;
    &lt;/suiteXmlFiles&gt;
  &lt;/configuration&gt;
&lt;/plugin&gt;
</pre>
<p>Now I can run min/max tests for each project which depend on the above super-pom. The test-min is the default profile and would be used on the continuous integration system (i.e. <a href="http://www.jetbrains.com/teamcity/">TeamCity</a>).</p>
<p>Try it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/496/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=496&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/11/26/concept-to-handle-minimal-and-maximal-tests-in-a-maven-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Maven https repository with self-signed ssl certificate</title>
		<link>http://ahoehma.wordpress.com/2009/11/17/maven-https-repository-with-self-signed-ssl-certificate/</link>
		<comments>http://ahoehma.wordpress.com/2009/11/17/maven-https-repository-with-self-signed-ssl-certificate/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 12:39:56 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[self signed]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=488</guid>
		<description><![CDATA[For a private project I try to use nexus behind apache and ssl. I used a self-signed certificate.
But each nexus repository request ends with a security exception:
[WARNING] repository metadata for: 'artifact org.apache.maven.plugins:maven-enforcer-plugin' could not be retrieved from repository: nexus-plugin-releases due to an error: Error transferring file: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=488&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For a private project I try to use nexus behind apache and ssl. I used a self-signed certificate.</p>
<p>But each nexus repository request ends with a security exception:</p>
<p><code>[WARNING] repository metadata for: 'artifact org.apache.maven.plugins:maven-enforcer-plugin' could not be retrieved from repository: nexus-plugin-releases due to an error: Error transferring file: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target<br />
</code></p>
<p>I found many site for that problem and they describe always the same solution</p>
<p><strong>import the self signed cert in your local truststore!</strong></p>
<p>&#8230; here are the steps:</p>
<ol>
<li>download the certificate</li>
<li>create a local truststore and import the certificat</li>
<li>call maven with the correct security properties</li>
</ol>
<p>The import is simple  (java keytool):</p>
<pre>keytool.exe -importcert
            -alias nexus-xxx
            -keystore xxx.jks
            -storepass secret
            -file xxx.crt</pre>
<p>For maven I&#8217;m using a cygwin bash alias:</p>
<pre>alias mvn_xxx='/cygdrive/d/maven-2.2.1/bin/mvn
-gs "d:/maven-2.2.1/conf/settings-xxx.xml"
-s "d:/maven-2.2.1/conf/settings-xxx.xml"
-Djavax.net.ssl.trustStore=d:/maven-2.2.1/conf/xxx.jks
-Djavax.net.ssl.trustStorePassword=secret'</pre>
<p>I point the global config  (<em>-gs</em>) and the personal config (<em>-s</em>) to the same file to ignore other configuration from my default maven config file (i.e. common mirros settings / repositories etc.).</p>
<p>And at least here is my complete maven setting-nexus settings:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/settings/1.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;

  &lt;localRepository&gt;D:\maven-repository-xxx&lt;/localRepository&gt;

  &lt;mirrors&gt;
    &lt;mirror&gt;
      &lt;id&gt;xxx-nexus-snapshots&lt;/id&gt;
      &lt;mirrorOf&gt;nexus-snapshots&lt;/mirrorOf&gt;
      &lt;url&gt;https://nexus.xxx.com/content/groups/public-snapshots/&lt;/url&gt;
    &lt;/mirror&gt;
    &lt;mirror&gt;
      &lt;id&gt;xxx-nexus-snapshots&lt;/id&gt;
      &lt;mirrorOf&gt;nexus-plugin-snapshots&lt;/mirrorOf&gt;
      &lt;url&gt;https://nexus.xxx.com/content/groups/public-snapshots/&lt;/url&gt;
    &lt;/mirror&gt;
    &lt;mirror&gt;
      &lt;id&gt;xxx-nexus-releases&lt;/id&gt;
      &lt;mirrorOf&gt;nexus-releases&lt;/mirrorOf&gt;
      &lt;url&gt;https://nexus.xxx.com/content/groups/public/&lt;/url&gt;
    &lt;/mirror&gt;
    &lt;mirror&gt;
      &lt;id&gt;xxx-nexus-releases&lt;/id&gt;
      &lt;mirrorOf&gt;nexus-plugin-releases&lt;/mirrorOf&gt;
      &lt;url&gt;https://nexus.xxx.com/content/groups/public/&lt;/url&gt;
    &lt;/mirror&gt;
    &lt;mirror&gt;
      &lt;id&gt;xxx-nexus-releases&lt;/id&gt;
      &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
      &lt;url&gt;https://nexus.xxx.com/content/groups/public/&lt;/url&gt;
    &lt;/mirror&gt;
  &lt;/mirrors&gt;

  &lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;xxx-nexus-mirror&lt;/id&gt;
      &lt;activation&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;repositories&gt;
        &lt;repository&gt;
          &lt;id&gt;nexus-releases&lt;/id&gt;
          &lt;url&gt;http://foobar&lt;/url&gt;
          &lt;releases&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/repository&gt;
        &lt;repository&gt;
          &lt;id&gt;nexus-snapshots&lt;/id&gt;
          &lt;url&gt;http://foobar&lt;/url&gt;
          &lt;releases&gt;
            &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
        &lt;pluginRepository&gt;
          &lt;id&gt;nexus-plugin-releases&lt;/id&gt;
          &lt;url&gt;http://foobar&lt;/url&gt;
          &lt;releases&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/pluginRepository&gt;
        &lt;pluginRepository&gt;
          &lt;id&gt;nexus-plugin-snapshots&lt;/id&gt;
          &lt;url&gt;http://foobar&lt;/url&gt;
          &lt;releases&gt;
            &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
        &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;

  &lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;xxx-nexus-releases&lt;/id&gt;
      &lt;username&gt;foo&lt;/username&gt;
      &lt;password&gt;bar&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;xxx-nexus-snapshots&lt;/id&gt;
      &lt;username&gt;foo&lt;/username&gt;
      &lt;password&gt;bar&lt;/password&gt;
    &lt;/server&gt;
  &lt;/servers&gt;

&lt;/settings&gt;
</pre>
<p>You can replace xxx with your personal domain-alias.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/488/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/488/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/488/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=488&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/11/17/maven-https-repository-with-self-signed-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Build eclipse applications with maven 3</title>
		<link>http://ahoehma.wordpress.com/2009/11/13/build-eclipse-applications-with-maven-3/</link>
		<comments>http://ahoehma.wordpress.com/2009/11/13/build-eclipse-applications-with-maven-3/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 16:08:41 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[rcp]]></category>
		<category><![CDATA[tycho]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=460</guid>
		<description><![CDATA[The  tool chain for building eclipse based applications with maven becomes better and better.
Read here.
I know 2 projects using maven to build eclipse plugins:

m2eclipse
Eclipse Tigerstripe

Which project are there else?
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=460&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The  tool chain for building eclipse based applications with maven becomes better and better.</p>
<p>Read <a href="http://www.sonatype.com/people/2009/11/maven-30-alpha-3-released/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+sonatype+%28Sonatype+Blogs%29&amp;utm_content=Google+International" target="_blank">here</a>.</p>
<p>I know 2 projects using maven to build eclipse plugins:</p>
<ul>
<li><a href="http://m2eclipse.sonatype.org/" target="_blank">m2eclipse</a></li>
<li><a href="http://www.eclipse.org/tigerstripe/" target="_blank">Eclipse Tigerstripe</a></li>
</ul>
<p>Which project are there else?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/460/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=460&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/11/13/build-eclipse-applications-with-maven-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Quality Center Mylyn Integration</title>
		<link>http://ahoehma.wordpress.com/2009/10/28/quality-center-mylyn-integration/</link>
		<comments>http://ahoehma.wordpress.com/2009/10/28/quality-center-mylyn-integration/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 07:54:59 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[com4j]]></category>
		<category><![CDATA[mylyn]]></category>
		<category><![CDATA[qc]]></category>
		<category><![CDATA[quality center]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=407</guid>
		<description><![CDATA[There is a interesting project at sourceforge called qcMylyn.  The projects aims to provide a Mylyn connector for Quality Center. Support Eclipse 3.4.2, 3.5, Mylyn 3.0.5+.
I tried the released version 0.2.4 but it didn&#8217;t work because at work we are using an older version of QualityCenter (9.1). But this was no big problem I have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=407&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There is a interesting project at sourceforge called <a href="http://sourceforge.net/projects/qcmylyn/" target="_blank">qcMylyn</a>.  The projects aims to provide a Mylyn connector for Quality Center. Support Eclipse 3.4.2, 3.5, Mylyn 3.0.5+.</p>
<p>I tried the released version 0.2.4 but it didn&#8217;t work because at work we are using an older version of QualityCenter (9.1). But this was no big problem I have the sourcecode (OS rocks) and I&#8217;m a programmer <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I found out that a other project called <a href="http://sourceforge.net/projects/qctools4j/" target="_blank">QcTools4J </a>contains the java code for manipulation a QC system. They using a <a href="https://com4j.dev.java.net/" target="_blank">com4j</a> bridge to bind QC&#8217;s<em> otaclient.dll</em>.</p>
<p><strong>If you have trouble with a older/newer version of QC you have to update the qctools4j</strong>.</p>
<p>You find a short tutorial how to update qctools4j <a href="https://sourceforge.net/apps/phpbb/qcmylyn/viewtopic.php?f=1&amp;t=1#p11" target="_blank">here.</a> (read this first) &#8230; then you will come to the point where you want create a new otaclient.jar from you local otaclient.dll. Here is my simple solution for that.</p>
<p>I create my own otaclient maven project with the following pom:</p>
<pre class="brush: xml;">
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;otaclient&lt;/groupId&gt;
      &lt;artifactId&gt;otaclient&lt;/artifactId&gt;
      &lt;version&gt;9.1.0.4372&lt;/version&gt;
      &lt;dependencies&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.jvnet.com4j&lt;/groupId&gt;
          &lt;artifactId&gt;com4j&lt;/artifactId&gt;
          &lt;version&gt;20080107&lt;/version&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
        &lt;plugins&gt;
          &lt;plugin&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
              &lt;source&gt;1.5&lt;/source&gt;
              &lt;target&gt;1.5&lt;/target&gt;
            &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.jvnet.com4j&lt;/groupId&gt;
            &lt;artifactId&gt;maven-com4j-plugin&lt;/artifactId&gt;
            &lt;executions&gt;
              &lt;execution&gt;
                &lt;id&gt;gen-java-bridge&lt;/id&gt;
                &lt;goals&gt;
                  &lt;goal&gt;gen&lt;/goal&gt;
                &lt;/goals&gt;
                &lt;configuration&gt;
                  &lt;file&gt;src/qc/OTAClient.dll&lt;/file&gt;
                  &lt;package&gt;com.mercury.qualitycenter.otaclient&lt;/package&gt;
                &lt;/configuration&gt;
              &lt;/execution&gt;
            &lt;/executions&gt;
          &lt;/plugin&gt;
        &lt;/plugins&gt;
      &lt;/build&gt;
    &lt;/project&gt;
</pre>
<p>I using the maven-com4j-plugin to generate the java layer for otaclient.</p>
<p>All you have to do is to <strong>extract</strong> your &#8220;qc client package&#8221; (could be download from every qc server page) into <strong>src/qc</strong> and start <strong>mvn clean package</strong>.</p>
<p>Then target will contain a otaclient-9.1.0.4372.jar. Copy this jar into qctools4j/lib/com.mercury.qualitycenter.otaclient-9.2.jar and rebuild qctools4j. That&#8217;s all <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="aligncenter size-full wp-image-418" title="qcmylyn_otaclient" src="http://ahoehma.files.wordpress.com/2009/10/qcmylyn_otaclient.png?w=384&#038;h=224" alt="qcmylyn_otaclient" width="384" height="224" /></p>
<p>Then copy the qctools4j.jar into org.tszadel.qctools and rebuild the whole eclipse feature.</p>
<p><img class="aligncenter size-full wp-image-415" title="qcmylyn_qctools4j" src="http://ahoehma.files.wordpress.com/2009/10/qcmylyn_qctools4j.png?w=317&#038;h=280" alt="qcmylyn_qctools4j" width="317" height="280" /></p>
<p>Try it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/407/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=407&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/10/28/quality-center-mylyn-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/10/qcmylyn_otaclient.png" medium="image">
			<media:title type="html">qcmylyn_otaclient</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/10/qcmylyn_qctools4j.png" medium="image">
			<media:title type="html">qcmylyn_qctools4j</media:title>
		</media:content>
	</item>
		<item>
		<title>How to use multiple maven versions parallel</title>
		<link>http://ahoehma.wordpress.com/2009/09/03/how-to-use-multiple-maven-versions-parallel/</link>
		<comments>http://ahoehma.wordpress.com/2009/09/03/how-to-use-multiple-maven-versions-parallel/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 13:01:22 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven 2]]></category>
		<category><![CDATA[multiple versions]]></category>
		<category><![CDATA[tycho]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=317</guid>
		<description><![CDATA[I need (two) different maven versions in my development system, a actual maven (2.2.1) for the &#8220;normal&#8221; work and a tycho-maven for eclipse-osgi projects (i.e. m2eclipse).
Setup maven installations

I created two directories maven-repos and maven-distro
Download maven (2.2.1) from http://maven.apache.org/download.html, unpack into maven-distro
Download maven-tycho (0.4.0-DEV*) from https://docs.sonatype.org/display/M2ECLIPSE/Tycho+builds, unpack into maven-distro
Go into maven-distro/maven-tycho/bin and rename all mvn*** into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=317&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I need (two) different maven versions in my development system, a actual maven (2.2.1) for the &#8220;normal&#8221; work and a tycho-maven for eclipse-osgi projects (i.e. m2eclipse).</p>
<h4>Setup maven installations</h4>
<ul>
<li>I created two directories <em>maven-repos</em> and <em>maven-distro</em></li>
<li>Download maven (2.2.1) from http://maven.apache.org/download.html, unpack into <em>maven-distro</em></li>
<li>Download maven-tycho (0.4.0-DEV*) from https://docs.sonatype.org/display/M2ECLIPSE/Tycho+builds, unpack into <em>maven-distro</em></li>
<li>Go into <em>maven-distro/maven-tycho/bin</em> and rename all <em>mvn***</em> into <em>tycho***</em></li>
<li>Create a repository path for each maven</li>
</ul>
<p>The result should look like this:</p>
<p><img src="http://ahoehma.files.wordpress.com/2009/09/multiple_maven_installation.png?w=129&#038;h=272" alt="multiple_maven_installation" title="multiple_maven_installation" width="129" height="272" class="aligncenter size-full wp-image-318" /></p>
<p><img src="http://ahoehma.files.wordpress.com/2009/09/multiple_maven_installation_tycho.png?w=666&#038;h=440" alt="multiple_maven_installation_tycho" title="multiple_maven_installation_tycho" width="666" height="440" class="aligncenter size-full wp-image-324" /></p>
<h4>Configure maven installations</h4>
<p>The <strong>tycho maven</strong> in <em>D:\maven-distro\maven-tycho\conf</em> contains a <em>settings-tycho.xml</em>:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;
  &lt;localRepository&gt;D:\maven-repos\maven-tycho&lt;/localRepository&gt;
&lt;/settings&gt;
</pre>
<p>and a <em>settings.xml</em> (this is the changed &#8220;standard&#8221; maven configuration):</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/settings/1.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;
  &lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;tycho-default&lt;/id&gt;
      &lt;repositories&gt;
        &lt;repository&gt;
          &lt;id&gt;forge&lt;/id&gt;
          &lt;url&gt; http://repository.sonatype.org/content/groups/public&lt;/url&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
          &lt;releases&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
        &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;pluginRepositories&gt;
        &lt;pluginRepository&gt;
          &lt;id&gt;forge&lt;/id&gt;
          &lt;url&gt; http://repository.sonatype.org/content/groups/public&lt;/url&gt;
          &lt;snapshots&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
          &lt;releases&gt;
            &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
        &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;activeProfiles&gt;
    &lt;activeProfile&gt;tycho-default&lt;/activeProfile&gt;
  &lt;/activeProfiles&gt;
&lt;/settings&gt;
</pre>
<p>The standard <strong>maven</strong> in <em>D:\maven-distro\maven-2.2.1\conf</em> must not be changed. So this maven will use the default <em>settings.xml</em> and a user-settings from $HOME/.m2/settings.xml:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;
  &lt;localRepository&gt;D:\maven-repos\maven&lt;/localRepository&gt;
&lt;/settings&gt;
</pre>
<h4>Configure development environment</h4>
<p>I use cygwin under windows, so i can put the maven-tycho-alias into my ~/.bashrc:</p>
<pre class="brush: bash;">
# Add maven-tycho to path
alias mvnTycho=&quot;tycho -s \&quot;d:/maven-distro/maven-tycho/conf/settings-tycho.xml\&quot;&quot;
export PATH=&quot;/cygdrive/d/maven-distro/maven-tycho/bin&quot;:$PATH
</pre>
<h4>Usage</h4>
<pre class="brush: bash;">
hoehmann@foobar /bin
$ mvnTycho --version
Apache Maven 3.0-TYCHO-797695 (r797704; 2009-07-25 04:43:26+0200)
Java version: 1.5.0_12
Java home: d:\java\jdk1.5.0_12\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: &quot;windows xp&quot; version: &quot;5.1&quot; arch: &quot;x86&quot; Family: &quot;windows&quot;

hoehmann@foobar /bin
$ mvn --version
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.5.0_12
Java home: d:\java\jdk1.5.0_12\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: &quot;windows xp&quot; version: &quot;5.1&quot; arch: &quot;x86&quot; Family: &quot;windows&quot;
</pre>
<p>With this i can run <b>mvn</b> for &#8220;normal&#8221; maven projects, this will start maven 2.2.1 from <em>maven-distro/maven/ and the repo will be at <em>maven-repo/maven/</em>. </p>
<p>Or i can run <b>mvnTycho</b> for &#8220;osgi&#8221; maven projects, this will start tycho from <em>maven-distro/maven-tycho/ and the repo will be at <em>maven-repo/maven-tycho/</em>.</p>
<p>You can do this with much more versions (2.0.1, 2.1.0, 2.2.0) and each maven will have a own repository.</p>
<p>Try it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=317&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/09/03/how-to-use-multiple-maven-versions-parallel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/09/multiple_maven_installation.png" medium="image">
			<media:title type="html">multiple_maven_installation</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/09/multiple_maven_installation_tycho.png" medium="image">
			<media:title type="html">multiple_maven_installation_tycho</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Maven Artifact Version in Eclipse Code Templates</title>
		<link>http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/</link>
		<comments>http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 11:41:48 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Maven-Eclipse-Plugin]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[code template]]></category>
		<category><![CDATA[extension point]]></category>
		<category><![CDATA[m2eclipse]]></category>
		<category><![CDATA[pde]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[pom]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=294</guid>
		<description><![CDATA[Based on waffel&#8217;s blog i wrote a eclipse plugin which provides the current artifact-version of a maven-project to the eclipse editor-templates. Waffel want to add the current plugin id/version to the @since field for class comments, i want to add the current version of my maven-eclipse-project. Let me explain my solution.
It&#8217;s easy to add a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=294&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Based on waffel&#8217;s <a href="http://thomaswabner.wordpress.com/2009/08/21/use-your-own-variable-in-eclipse-code-templates/" target="_blank">blog</a> i wrote a eclipse plugin which provides the current artifact-version of a maven-project to the eclipse editor-templates. Waffel want to add the current plugin id/version to the @since field for class comments, i want to add the current version of my maven-eclipse-project. Let me explain my solution.</p>
<p>It&#8217;s easy to add a new template-variable to eclipse, you can read <a href="http://dev.eclipse.org/blogs/jdtui/2007/12/04/text-templates-2/" target="_blank">this</a>. Based on  <a href="http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/templates/TemplateVariableResolver.html" target="_blank">org.eclipse.jface.text.templates.TemplateVariableResolver</a> we can write a MavenVersionResolver:</p>
<pre class="brush: java;">

/**
 * Resolver to resolve variable &lt;code&gt;pomVersion&lt;/code&gt;.
 *
 * @author hoehmann
 * @since 1.0.0
 */
public class MavenVersionResolver extends TemplateVariableResolver {

  public MavenVersionResolver() {
    super();
  }

  private String getMavenVersion(final IProject project) {
    if (project == null) {
      throw new IllegalArgumentException(&quot;Missing project&quot;); //$NON-NLS-1$
    }
    String result = &quot;&quot;; //$NON-NLS-1$
    try {
      if (project.hasNature(IMavenConstants.NATURE_ID)) {
        final MavenProjectManager projectManager = MavenPlugin.getDefault()
            .getMavenProjectManager();
        final IMavenProjectFacade projectFacade = projectManager.create(
            project, new NullProgressMonitor());
        if (projectFacade != null) {
          final ArtifactKey mavenProject = projectFacade.getArtifactKey();
          if (mavenProject != null) {
            result = mavenProject.getVersion();
            // remove snapshot-indicator
            final int index = result.lastIndexOf(&quot;-SNAPSHOT&quot;); //$NON-NLS-1$
            if (index != -1) {
              result = result.substring(0, index);
            }
          }
        }
      }
    } catch (final CoreException ex) {
      MavenLogger.log(ex);
    }
    return result;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  protected String resolve(final TemplateContext context) {
    // TODO better way to get the project?!
    return getMavenVersion(((CodeTemplateContext) context).getJavaProject()
        .getProject());
  }
}
</pre>
<p>With the <a href="http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse/src/org/maven/ide/eclipse/project/MavenProjectManager.java" target="_blank">MavenProjectManager</a> from <a href="http://m2eclipse.sonatype.org/" target="_blank">m2eclipse</a> we can create a <a href="http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse/src/org/maven/ide/eclipse/project/IMavenProjectFacade.java" target="_self">IMavenProjectFacade</a>, this facade returns the ArtifactKey and this key have the version. If the version is a snapshot-version we can cut this trailing string off and the result is the (next) version for our maven-project (for me it doesn&#8217;t make sense to add the snapshot-version into a @since comment because the release-version should be documented in the sourcecode).</p>
<p>Maybe the check for the &#8220;m2eclipse&#8221;-nature is not necessary:</p>
<pre class="brush: java;">
if (project.hasNature(IMavenConstants.NATURE_ID)) {....}
</pre>
<p>I tried without the nature-check and it works. The project must contain a &#8220;pom.xml&#8221; to get a IMavenProjectFacade.</p>
<p>This was the first part of the solution. The placeholder &#8220;pom_version&#8221; will be available for all editor-templates in the &#8220;java-context&#8221;:</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-298" title="maven_version_editortemplate" src="http://ahoehma.files.wordpress.com/2009/08/maven_version_editortemplate1.png?w=700&#038;h=505" alt="maven_version_editortemplate" width="700" height="505" /></p>
<p style="text-align:left;">
<p style="text-align:left;">Waffel described already a solution (a workaround) to use a editor-template-resolver in the code-templates. He registered a <a href="http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IStartup.html" target="_blank">IStartup </a>class which copies his own BundleIdResolver/BundleVersionResolver into the (internal) code-template-context-registry of the Eclipse-Java-Plugin. For waffel this was fine because he doesn&#8217;t register his resolvers as editor-template-resolvers. I want use my MavenVersionResolver in all java-templates <strong>and</strong> in the code-templates.</p>
<p style="text-align:left;"><strong>And i don&#8217;t want create a new instance</strong> of the resolver, i want reuse the extension-point-configured resolver. So i have only one place to define my resolver (type = &#8216;pom_version&#8217;, localized name, localized description, class etc.).</p>
<p style="text-align:left;">I found a other way to register the resolver</p>
<ol>
<li>i search my MavenVersionResolver in the registered editor-templates (java-context)</li>
<li>if i found one, i add this reference to the (internal) code-template-registry</li>
</ol>
<p style="text-align:left;">
<pre class="brush: java;">

/**
 * Currently it's not possible to provide more variables for
 * &lt;tt&gt;java-code-templates&lt;/tt&gt;, we can only add more &lt;tt&gt;editor-templates&lt;/tt&gt;
 * via extension-point.
 *
 * &lt;p&gt;
 * This {@link IStartup} is a workaround to register our
 * {@link MavenVersionResolver} for &lt;tt&gt;java-code-templates&lt;/tt&gt; too.
 * &lt;/p&gt;
 *
 * @author hoehmann
 * @since 1.0.0
 */
public class RegisterResolvers implements IStartup {

  private static final String JAVA_PLUGIN_ID = &quot;org.eclipse.jdt.ui&quot;; //$NON-NLS-1$

  /**
   * Add our resolver to each registered code-template-context.
   *
   * @param javaPlugin
   *          must not be &lt;code&gt;null&lt;/code&gt;
   * @param mavenVersionResolver
   *          must not be &lt;code&gt;null&lt;/code&gt;
   */
  private void addMavenVersionResolver(final JavaPlugin javaPlugin,
      final MavenVersionResolver mavenVersionResolver) {
    Assert.isNotNull(javaPlugin);
    final ContextTypeRegistry codeTemplateContextRegistry = javaPlugin
        .getCodeTemplateContextRegistry();
    Assert.isNotNull(codeTemplateContextRegistry);
    final Iterator ctIter = codeTemplateContextRegistry.contextTypes();
    while (ctIter.hasNext()) {
      final TemplateContextType contextType = (TemplateContextType) ctIter
          .next();
      contextType.addResolver(mavenVersionResolver);
    }
  }

  /**
   * {@inheritDoc}
   */
  public void earlyStartup() {
    // check if plug-in org.eclipse.jdt.ui is final already active
    final Bundle bundle = Platform.getBundle(JAVA_PLUGIN_ID);
    if (bundle != null &amp;&amp; bundle.getState() == Bundle.ACTIVE) {
      registerResolvers();
    } else {
      // register listener to final get informed, when plug-in final becomes
      // active
      final BundleContext bundleContext = Activator.getDefault().getBundle()
          .getBundleContext();
      bundleContext.addBundleListener(new BundleListener() {
        public void bundleChanged(final BundleEvent pEvent) {
          final Bundle eventBundle = pEvent.getBundle();
          if (!eventBundle.getSymbolicName().equals(JAVA_PLUGIN_ID)) {
            // ignore other plugins
            return;
          }
          if (eventBundle.getState() == Bundle.ACTIVE) {
            registerResolvers();
            bundleContext.removeBundleListener(this);
          }
        }
      });
    }
  }

  /**
   * Try to find our {@link MavenVersionResolver} in the java-plugin
   * template-context-registry.
   *
   * @param javaPlugin
   *          must not be &lt;code&gt;null&lt;/code&gt;
   * @return
   */
  private MavenVersionResolver getMavenVersionResolver(
      final JavaPlugin javaPlugin) {
    Assert.isNotNull(javaPlugin);
    final ContextTypeRegistry contextRegistry = javaPlugin
        .getTemplateContextRegistry();
    Assert.isNotNull(contextRegistry);
    final TemplateContextType javaContextType = contextRegistry
        .getContextType(JavaContextType.ID_ALL);
    Assert.isNotNull(javaContextType);
    final Iterator&lt;TemplateVariableResolver&gt; resolvers = javaContextType
        .resolvers();
    MavenVersionResolver mavenVersionResolver = null;
    while (resolvers.hasNext()) {
      final TemplateVariableResolver resolver = resolvers.next();
      if (resolver instanceof MavenVersionResolver) {
        mavenVersionResolver = (MavenVersionResolver) resolver;
        break;
      }
    }
    return mavenVersionResolver;
  }

  /**
   * First find the maven-version-resolver from the registered resolvers.
   */
  private void registerResolvers() {
    final JavaPlugin javaPlugin = JavaPlugin.getDefault();
    if (javaPlugin == null) {
      throw new IllegalStateException(String.format(
          &quot;Expected plugin '%s' is not available&quot;, JAVA_PLUGIN_ID));
    }
    final MavenVersionResolver mavenVersionResolver = getMavenVersionResolver(javaPlugin);
    if (mavenVersionResolver != null) {
      addMavenVersionResolver(javaPlugin, mavenVersionResolver);
    }
  }
}
</pre>
<p style="text-align:left;">Now its possible to use &#8220;pom_version&#8221; in code-templates too:</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-306" title="maven_version_codetemplate" src="http://ahoehma.files.wordpress.com/2009/08/maven_version_codetemplate.png?w=699&#038;h=505" alt="maven_version_codetemplate" width="699" height="505" /></p>
<p style="text-align:left;">Now the final test  &#8230;  create a &#8220;normal&#8221; java-project, create a new class. The javadoc will not contain a version (the project doesn&#8217;t have a maven-nature):</p>
<p style="text-align:left;"><img class="aligncenter size-full wp-image-308" title="maven_version_test_without_m2eclipse" src="http://ahoehma.files.wordpress.com/2009/08/maven_version_test_without_m2eclipse.png?w=971&#038;h=702" alt="maven_version_test_without_m2eclipse" width="971" height="702" /></p>
<p style="text-align:left;">If the project is a &#8220;real&#8221; maven project the version will be available:</p>
<p style="text-align:left;"><img class="aligncenter size-full wp-image-309" title="maven_version_test_with_m2eclipse" src="http://ahoehma.files.wordpress.com/2009/08/maven_version_test_with_m2eclipse.png?w=971&#038;h=702" alt="maven_version_test_with_m2eclipse" width="971" height="702" /></p>
<p style="text-align:left;">If anyone need the plugin &#8230; leave a comment.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/294/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=294&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/08/24/use-maven-artifact-version-in-eclipse-templates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/08/maven_version_editortemplate1.png" medium="image">
			<media:title type="html">maven_version_editortemplate</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/08/maven_version_codetemplate.png" medium="image">
			<media:title type="html">maven_version_codetemplate</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/08/maven_version_test_without_m2eclipse.png" medium="image">
			<media:title type="html">maven_version_test_without_m2eclipse</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/08/maven_version_test_with_m2eclipse.png" medium="image">
			<media:title type="html">maven_version_test_with_m2eclipse</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploy maven war-project to tomcat</title>
		<link>http://ahoehma.wordpress.com/2009/07/10/deploy-maven-war-project-to-tomcat/</link>
		<comments>http://ahoehma.wordpress.com/2009/07/10/deploy-maven-war-project-to-tomcat/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 09:24:11 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[buildnumber-plugin]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[war]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=243</guid>
		<description><![CDATA[With maven it&#8217;s possible to deploy the current version of your webapplication (&#60;packaging&#62;war&#60;/packaging&#62;) with one command!
mvn clean package tomcat:deploy-only
All we have to to is to define the tomcat-maven-plugin:


...
&#60;packaging&#62;war&#60;/packaging&#62;
...
&#60;plugin&#62;
 &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62;
 &#60;artifactId&#62;tomcat-maven-plugin&#60;/artifactId&#62;
 &#60;configuration&#62;
 &#60;url&#62;http://server[:port]/manager&#60;/url&#62;
&#60;path&#62;/${project.build.finalName}&#60;/path&#62;
 &#60;update&#62;true&#60;/update&#62;
&#60;server&#62;tomcat_xyz&#60;/server&#62;
 &#60;/configuration&#62;
 &#60;/plugin&#62;

You have to define username/password in your settings.xml:

&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;settings xmlns=&#34;http://maven.apache.org/POM/4.0.0&#34; xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
 xsi:schemaLocation=&#34;http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/xsd/settings-1.0.0.xsd&#34;&#62;

&#60;servers&#62;
&#60;server&#62;
&#60;id&#62;tomcat_xyz&#60;/id&#62;
&#60;username&#62;admin&#60;/username&#62;
&#60;password&#62;123geheim&#60;/password&#62;
&#60;/server&#62;
&#60;/servers&#62;

&#60;/settings&#62;

Check the tomcat-user.xml:

&#60;?xml version='1.0' encoding='utf-8'?&#62;
&#60;tomcat-users&#62;
 &#60;role rolename=&#34;manager&#34;/&#62;
 &#60;role [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=243&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>With maven it&#8217;s possible to deploy the current version of your webapplication (&lt;packaging&gt;war&lt;/packaging&gt;) with one command!</p>
<pre>mvn clean package tomcat:deploy-only</pre>
<p>All we have to to is to define the tomcat-maven-plugin:</p>
<pre class="brush: xml;">

...
&lt;packaging&gt;war&lt;/packaging&gt;
...
&lt;plugin&gt;
 &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
 &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
 &lt;configuration&gt;
 &lt;url&gt;http://server[:port]/manager&lt;/url&gt;
&lt;path&gt;/${project.build.finalName}&lt;/path&gt;
 &lt;update&gt;true&lt;/update&gt;
&lt;server&gt;tomcat_xyz&lt;/server&gt;
 &lt;/configuration&gt;
 &lt;/plugin&gt;
</pre>
<p>You have to define username/password in your settings.xml:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;settings xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/xsd/settings-1.0.0.xsd&quot;&gt;

&lt;servers&gt;
&lt;server&gt;
&lt;id&gt;tomcat_xyz&lt;/id&gt;
&lt;username&gt;admin&lt;/username&gt;
&lt;password&gt;123geheim&lt;/password&gt;
&lt;/server&gt;
&lt;/servers&gt;

&lt;/settings&gt;
</pre>
<p>Check the tomcat-user.xml:</p>
<pre class="brush: xml;">
&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;tomcat-users&gt;
 &lt;role rolename=&quot;manager&quot;/&gt;
 &lt;role rolename=&quot;admin&quot;/&gt;
 &lt;user username=&quot;admin&quot; password=&quot;123geheim&quot; roles=&quot;admin,manager&quot;/&gt;
&lt;/tomcat-users&gt;
</pre>
<p>If you  run the maven command you will see:</p>
<pre>[INFO] [tomcat:deploy-only {execution: default-cli}]
[INFO] Deploying war to http://server:8080/foobar-1.0.0-SNAPSHOT-B20090710  
[INFO] OK - Deployed application at context path /foobar-1.0.0-SNAPSHOT-B20090710
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------</pre>
<p>To get the version and a buildnumber in the context-path you must define the finalName and you must use a &#8220;buildnumber-plugin&#8221;, e.g.  <a href="http://mojo.codehaus.org/buildnumber-maven-plugin/index.html" target="_blank">buildnumber-maven-plugin</a> or <a href="http://code.google.com/p/maven-timestamp-plugin/" target="_blank">maven-timestamp-plugin</a>:</p>
<pre class="brush: xml;">

&lt;build&gt;
 &lt;finalName&gt;foobar-${project.version}-B${buildNumber}&lt;/finalName&gt;
 &lt;/build&gt;
</pre>
<pre class="brush: xml;">
&lt;plugins&gt;
&lt;plugin&gt;
 &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
 &lt;artifactId&gt;buildnumber-maven-plugin&lt;/artifactId&gt;
 &lt;executions&gt;
 &lt;execution&gt;
 &lt;id&gt;create-buildnumber&lt;/id&gt;
&lt;phase&gt;validate&lt;/phase&gt;
 &lt;goals&gt;
 &lt;goal&gt;create&lt;/goal&gt;
 &lt;/goals&gt;
 &lt;/execution&gt;
 &lt;/executions&gt;
 &lt;configuration&gt;
 &lt;doUpdate&gt;false&lt;/doUpdate&gt;
 &lt;doCheck&gt;false&lt;/doCheck&gt;
 &lt;format&gt;{0,date,yyyyMMdd}&lt;/format&gt;
 &lt;items&gt;
 &lt;item&gt;timestamp&lt;/item&gt;
 &lt;/items&gt;
 &lt;buildNumberPropertyName&gt;buildNumber&lt;/buildNumberPropertyName&gt;
&lt;/configuration&gt;
 &lt;/plugin&gt;
</pre>
<pre class="brush: xml;">
&lt;plugin&gt;
 &lt;groupId&gt;com.keyboardsamurais.maven&lt;/groupId&gt;
 &lt;artifactId&gt;maven-timestamp-plugin&lt;/artifactId&gt;
 &lt;executions&gt;
 &lt;execution&gt;
 &lt;id&gt;create-buildnumber&lt;/id&gt;
 &lt;goals&gt;
 &lt;goal&gt;create&lt;/goal&gt;
 &lt;/goals&gt;
 &lt;configuration&gt;
&lt;propertyName&gt;buildNumber&lt;/propertyName&gt;
 &lt;timestampPattern&gt;yyyyMMdd&lt;/timestampPattern&gt;
 &lt;/configuration&gt;
 &lt;/execution&gt;
 &lt;/executions&gt;
 &lt;/plugin&gt;

&lt;/plugins&gt;
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=243&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/07/10/deploy-maven-war-project-to-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Nexus Pro verwaltet Eclipse-Repositories</title>
		<link>http://ahoehma.wordpress.com/2009/06/08/nexus-pro-verwaltet-eclipse-repositories/</link>
		<comments>http://ahoehma.wordpress.com/2009/06/08/nexus-pro-verwaltet-eclipse-repositories/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 09:13:18 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=186</guid>
		<description><![CDATA[Mit Hilfe von Nexus-Pro (Version 1.3.2) ist es möglich Eclipse-Plugin-Repositories zu verwalten.
Damit wird es möglich für ein Entwicklungsteam eine Liste von Plugin-Repositories zentral zu verwalten. Alle Entwickler stellen in ihrem Eclipse Update Manager nur noch dieses eine Repository (Nexus) ein und fertig  
Vorteile:
- externer Netzwerktraffic wird reduziert
- Thema Sicherheit, Entwickler müssen nicht unbedingt ins [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=186&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mit Hilfe von <a href="http://www.sonatype.com/products/nexus" target="_blank">Nexus-Pro</a> (Version 1.3.2) ist es möglich Eclipse-Plugin-Repositories zu verwalten.</p>
<p>Damit wird es möglich für ein Entwicklungsteam eine Liste von Plugin-Repositories zentral zu verwalten. Alle Entwickler stellen in ihrem Eclipse Update Manager nur noch dieses eine Repository (Nexus) ein und fertig <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Vorteile:<br />
- externer Netzwerktraffic wird reduziert<br />
- Thema Sicherheit, Entwickler müssen nicht unbedingt ins Internet (Proxy etc.)<br />
- man sieht zentral welche Plugins, in welchen Versionen verwendet werden</p>
<p>Kurzes Video hier: <a href="http://vimeo.com/4102464" target="_blank">http://vimeo.com/4102464</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=186&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/06/08/nexus-pro-verwaltet-eclipse-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Hibernate sql logging with values</title>
		<link>http://ahoehma.wordpress.com/2009/06/03/hibernate-sql-logging-with-values/</link>
		<comments>http://ahoehma.wordpress.com/2009/06/03/hibernate-sql-logging-with-values/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 10:02:03 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Log4J]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=174</guid>
		<description><![CDATA[As you might know already, Hibernate supports logging for sql-statements. Your Spring-configuration (e.g. spring-database.xml) must contain this:


&#60;bean id=&#34;entityManagerFactory&#34;
 class=&#34;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&#34;&#62;
&#60;property name=&#34;dataSource&#34; ref=&#34;dataSource&#34; /&#62;
&#60;property name=&#34;persistenceUnitName&#34; value=&#34;logging-test&#34; /&#62;
&#60;property name=&#34;jpaVendorAdapter&#34;&#62;
 &#60;bean&#62;
&#60;property name=&#34;showSql&#34; value=&#34;true&#34; /&#62;
&#60;property name=&#34;generateDdl&#34; value=&#34;true&#34; /&#62;
&#60;property name=&#34;databasePlatform&#34; value=&#34;${jpa.hibernate.dialect}&#34; /&#62;
 &#60;/bean&#62;
 &#60;/property&#62;
&#60;property name=&#34;jpaProperties&#34; value=&#34;hibernate.dialect=${jpa.hibernate.dialect}&#34; /&#62;
 &#60;/bean&#62;

With showSql=true hibernate will show you logmessages like this:
Hibernate:
   delete
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=174&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As you might know already, Hibernate supports logging for sql-statements. Your Spring-configuration (e.g. spring-database.xml) must contain this:</p>
<pre class="brush: xml;">

&lt;bean id=&quot;entityManagerFactory&quot;
 class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot;&gt;
&lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&gt;
&lt;property name=&quot;persistenceUnitName&quot; value=&quot;logging-test&quot; /&gt;
&lt;property name=&quot;jpaVendorAdapter&quot;&gt;
 &lt;bean&gt;
&lt;property name=&quot;showSql&quot; value=&quot;true&quot; /&gt;
&lt;property name=&quot;generateDdl&quot; value=&quot;true&quot; /&gt;
&lt;property name=&quot;databasePlatform&quot; value=&quot;${jpa.hibernate.dialect}&quot; /&gt;
 &lt;/bean&gt;
 &lt;/property&gt;
&lt;property name=&quot;jpaProperties&quot; value=&quot;hibernate.dialect=${jpa.hibernate.dialect}&quot; /&gt;
 &lt;/bean&gt;
</pre>
<p>With <strong>showSql=true</strong> hibernate will show you logmessages like this:</p>
<pre>Hibernate:
   delete
   from
      SoftwareCategory_SoftwareCategory
   where
      SoftwareCategory_id=?
Hibernate:
   update
      SoftwareCategory
   set
      concurrentVersion=?,
      CATEGORY_NAME=?,
      PARENT_ID=?
   where
      id=?
      and concurrentVersion=?
Hibernate:
   insert
   into
      SoftwareCategory_SoftwareCategory
      (SoftwareCategory_id, POSITION, children_id)
   values
      (?, ?, ?)</pre>
<p>To see the values and not the placeholders (?) you must define the loglevel <strong>trace</strong> for <strong>hibernate-types</strong> in the log4j.xml:</p>
<pre class="brush: xml;">

&lt;category name=&quot;org.hibernate.type&quot;&gt;
&lt;priority value=&quot;trace&quot; /&gt;
 &lt;/category&gt;
</pre>
<p>Then you will see logmessages like this:</p>
<pre>Hibernate:
   insert
   into
      SoftwareCategory_SoftwareCategory
      (SoftwareCategory_id, POSITION, children_id)
   values
      (?, ?, ?)
NullableType:151 - binding '68' to parameter: 1
NullableType:151 - binding '0' to parameter: 2
NullableType:151 - binding '69' to parameter: 3</pre>
<p>Not bad but there is a better way for this <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Yesterday i found the project <a href="http://jdbclogger.sourceforge.net" target="_blank"><strong>JDBCLogger</strong></a>.  They have implemented a &#8220;JDBC-Proxy&#8221; with logging support. Its <a href="http://maven.apache.org/" target="_blank">Maven</a>-ready and comes with a easy <a href="http://www.springsource.org/" target="_blank">Spring</a>-integration. So how can we use this cool stuff &#8230; it is so easy:</p>
<p>1. Define the JDBCLogger dependencies in the pom.xml:</p>
<pre class="brush: xml;">

&lt;dependencies&gt;
&lt;dependency&gt;
 &lt;groupId&gt;net.sourceforge.jdbclogger&lt;/groupId&gt;
 &lt;artifactId&gt;jdbclogger-core&lt;/artifactId&gt;
 &lt;version&gt;0.7-SNAPSHOT&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;dependency&gt;
 &lt;groupId&gt;net.sourceforge.jdbclogger&lt;/groupId&gt;
 &lt;artifactId&gt;jdbclogger-spring&lt;/artifactId&gt;
 &lt;version&gt;0.7-SNAPSHOT&lt;/version&gt;
 &lt;/dependency&gt;
 &lt;/dependencies&gt;
</pre>
<p>The informations from the installation-guide on the project-site is a little too old, so the maven-repository http://jdbclogger.sourceforge.net/m2-repo/ doesn&#8217;t exists. No problem we can build jdbclogger-core and jdbclogger-spring by ourself (<a href="http://jdbclogger.sourceforge.net/building-maven.html" target="_blank">read more</a>). The simplest way to build the two artifacts is:</p>
<ul>
<li>checkout from  svn</li>
<li>edit master-pom, comment out all modules, leave only core and spring active</li>
<li>run mvn clean install from root-dir</li>
</ul>
<p>2. Change your Spring-configuration, switch showSql off and add the following bean:</p>
<pre class="brush: xml;">

&lt;bean id=&quot;jdbcLoggerConfig&quot;
 class=&quot;net.sourceforge.jdbclogger.spring.JdbcLoggerBeanPostProcessor&quot;&gt;
&lt;property name=&quot;enabled&quot; value=&quot;true&quot; /&gt;
&lt;property name=&quot;dataSourceConfigurations&quot;&gt;
	&lt;list&gt;
 &lt;bean class=&quot;net.sourceforge.jdbclogger.spring.JdbcLoggerDataSourceConfiguration&quot;&gt;
&lt;property name=&quot;dataSourceBeanName&quot; value=&quot;dataSource&quot; /&gt;
&lt;property name=&quot;driverClassNamePropertyName&quot; value=&quot;driverClassName&quot; /&gt;
 &lt;/bean&gt;
 &lt;/list&gt;
 &lt;/property&gt;
&lt;property name=&quot;targetDriverClassNames&quot;&gt;
	&lt;list&gt;
 &lt;value&gt;${jpa.driver}&lt;/value&gt;
 &lt;/list&gt;
 &lt;/property&gt;
 &lt;/bean&gt;
</pre>
<p>3.  Activate logging in the log4j.xml:</p>
<pre class="brush: xml;">

&lt;category name=&quot;net.sourceforge.jdbclogger&quot;&gt;
&lt;priority value=&quot;debug&quot; /&gt;
 &lt;/category&gt;
&lt;category name=&quot;net.sourceforge.jdbclogger.spring&quot;&gt;
&lt;priority value=&quot;error&quot; /&gt;
 &lt;/category&gt;
</pre>
<p>Thats it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Now you will see logmessages like this:</p>
<p>JdbcLoggerDriver:65 &#8211; Wrapper &#8216;net.sourceforge.jdbclogger.JdbcLoggerDriver&#8217; successfully registed for driver &#8216;com.mysql.jdbc.Driver&#8217;<br />
PreparedStatementWrapper:156 &#8211; Prepared Statement : select softwareca0_.id as id0_, softwareca0_.concurrentVersion as concurre2_0_, softwareca0_.CATEGORY_NAME as CATEGORY3_0_, softwareca0_.PARENT_ID as PARENT4_0_ from SoftwareCategory softwareca0_ where softwareca0_.PARENT_ID is null<br />
StatementWrapper:45 &#8211; Statement : delete from softwarecategory_softwareobject<br />
PreparedStatementWrapper:156 &#8211; Prepared Statement : insert into SoftwareCategory_SoftwareCategory (SoftwareCategory_id, POSITION, children_id) values (&#8216;92&#8242;, &#8216;3&#8242;, &#8216;96&#8242;)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=174&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/06/03/hibernate-sql-logging-with-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Speedup Release for Multiprojects with Maven</title>
		<link>http://ahoehma.wordpress.com/2009/05/05/speedup-release-for-multiprojects-with-maven/</link>
		<comments>http://ahoehma.wordpress.com/2009/05/05/speedup-release-for-multiprojects-with-maven/#comments</comments>
		<pubDate>Tue, 05 May 2009 10:29:32 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[Maven-Release-Plugin]]></category>
		<category><![CDATA[Site-Plugin]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=143</guid>
		<description><![CDATA[In huge multi-module-projects the maven-release-process might have a long running time because there is a lot of site-content to generate and to deployed (Of course this depends on the used report-plugins, i.e. javadoc, findbugs,pmd, dashboard etc.)
I noticed that the upload of the generated javadoc etc. uses a big amount of the deployment time. So how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=143&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In huge multi-module-projects the maven-release-process might have a long running time because there is a lot of site-content to generate <strong>and</strong> <strong>to deployed</strong> (Of course this depends on the used report-plugins, i.e. javadoc, findbugs,pmd, dashboard etc.)</p>
<p>I noticed that the upload of the generated javadoc etc. uses a big amount of the deployment time. So how we can speedup this part of the deployment?</p>
<p>We can deploy the generated site in a local directory and after the successful release we can upload the whole directory to the server, i.e. zip the content and unpack on the server, or use a smb-shared-directory &#8230; then the site-upload is much faster than with site:deploy and webdav.</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;

&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

&lt;distributionManagement&gt;
 &lt;site&gt;
 &lt;id&gt;site&lt;/id&gt;
 &lt;url&gt;${site.distribution.url}/&lt;/url&gt;
 &lt;/site&gt;
&lt;distributionManagement&gt;
&lt;profiles&gt;
&lt;profile&gt;
 &lt;id&gt;release&lt;/id&gt;
&lt;properties&gt;
 &lt;site.distribution.url&gt;file://D:/SITE-RELEASE/&lt;/site.distribution.url&gt;
 &lt;site.url&gt;http://site-server/releases/&lt;/site.url&gt;
 &lt;/properties&gt;
 &lt;/profile&gt;
&lt;/profiles&gt;
&lt;properties&gt;
 &lt;site.url&gt;http://site-server/snapshots/&lt;/site.url&gt;
 &lt;site.distribution.url&gt;dav:${site.url}&lt;/site.distribution.url&gt;
&lt;/properties&gt;

&lt;/project&gt;
</pre>
<p>Try it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=143&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/05/05/speedup-release-for-multiprojects-with-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
	</channel>
</rss>