<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>mkleint</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.codehaus.org/people/mkleint/atom.xml" />
    <id>tag:blogs.codehaus.org,2010-01-21:/people/mkleint//131</id>
    <updated>2010-04-15T14:17:51Z</updated>
    <subtitle>mkleint - mostly about maven and netbeans


</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.01</generator>

<entry>
    <title>Goodbye NetBeans!</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2010/04/goodbye-netbeans.html" />
    <id>tag:blogs.codehaus.org,2010:/people/mkleint//131.1833</id>

    <published>2010-04-12T10:30:56Z</published>
    <updated>2010-04-15T14:17:51Z</updated>

    <summary>Like others (not that my timing or reasons correlate in any way with others), I&apos;ve decided to move on and look for other opportunities outside Sun/Oracle. Working on NetBeans has been a great adventure of the last 10 years, I&apos;ve enjoyed every minute of it. I wish my former coworkers all the best. I will surely remember NetBeans as one of the highlights of my career. I&apos;ve accepted a position at Sonatype, the Maven company. If you want anything Maven, it&apos;s us :) I will be working on m2eclipse and other Apache Maven related products. So I will still be around in a way, working for the good of Maven ecosystem, even when not working the NetBeans Maven integration (in any foreseeable future at least). If you happen to be a Sonatype customer already (eg. by purchasing Nexus Pro) or are planning to become one and are using NetBeans in your team for developing Maven based applications, let me know. Either via Twitter or email. This blog will probably not get update very often in the future. *If* I start blogging about my new work, it will most likely be at Sonatype.....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Like <a href="http://www.dzone.com/links/james_gosling_time_to_move_on.html">others</a> (not that my timing or reasons correlate in any way with others), I've decided to move on and look for other opportunities outside Sun/Oracle. Working on NetBeans has been a great adventure of the last 10 years, I've enjoyed every minute of it. I wish my former coworkers all the best.  I will surely remember NetBeans as one of the highlights of my career.<br />
<br /><br />
I've accepted a position at <a href="http://www.sonatype.com">Sonatype</a>, the Maven company. If you want anything Maven, it's us :) I will be working on <a href="http://m2eclipse.sonatype.org/">m2eclipse</a> and other Apache Maven related products. So I will still be around in a way, working for the good of Maven ecosystem, even when not working the NetBeans Maven integration (in any foreseeable future at least).<br />
<br /><br />
If you happen to be a Sonatype customer already (eg. by purchasing <a href="http://www.sonatype.com/products/nexus">Nexus Pro</a>) or are planning to become one and are using NetBeans in your team for developing Maven based applications, let me know. Either via <a href="http://twitter.com/mkleint">Twitter</a> or <a href="mailto:milos@sonatype.com">email.</a></p>

<p>This blog will probably not get update very often in the future. *If* I start blogging about my new work, it will most likely be  <a href="http://www.sonatype.com/people/">at Sonatype.</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>license headers in maven projects</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2010/03/license-headers-in-maven-proje.html" />
    <id>tag:blogs.codehaus.org,2010:/people/mkleint//131.1832</id>

    <published>2010-03-28T09:57:17Z</published>
    <updated>2010-03-28T15:25:13Z</updated>

    <summary><![CDATA[Geertjan's old blog entry describes the general way of working with license headers. Let's add a few notes for all the Mavenites out there. There is no UI for setting the license for your project currently Use netbeans.hint.license property in your pom.xml file to point to the license header of choice. Please note that the ideal place for the property is the root parent pom of your project. There are few magic spots where it works out of the box. The Maven examines the &lt;license&gt; /&lt;url&gt; elements in the pom and when matching one of the hardwired urls, assigns the license header automatically. The current magic urls are: http://www.apache.org/licenses/LICENSE-2.0.txt http://www.opensource.org/licenses/mit-license.php http://www.gnu.org/licenses/gpl-2.0.html http://www.gnu.org/licenses/gpl-3.0.html There is currently no way to add this magical mapping to your custom license templates. If you have an OSS license that you would like be added, file an issue at netbeans.org (with the license template attached and url pointing to the license on the web. To have the license header added for your in-house non-OSS project, you can create a NetBeans module that will add the license header template declaratively. Ask me for details. UPDATE: I've actually forgot to mention the name of the property to put in the pom.xml file. it's "netbeans.hint.license"....]]></summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Geertjan's old <a href="http://blogs.sun.com/geertjan/entry/project_level_license_settings_in/">blog entry</a> describes the general way of working with license headers. Let's add a few notes for all the Mavenites out there.</p>

<ul>
	<li>There is no UI for setting the license for your project currently</li>
	<li>Use netbeans.hint.license property in your pom.xml file to point to the license header of choice. Please note that the ideal place for the property is the root parent pom of your project.</li>
	<li>There are few magic spots where it works out of the box. The Maven examines the &lt;license&gt; /&lt;url&gt; elements in the pom and when matching one of the hardwired urls, assigns the license header automatically. The current magic urls are:<ol>
	<li><a href="http://www.apache.org/licenses/LICENSE-2.0.txt">http://www.apache.org/licenses/LICENSE-2.0.txt</a></li>
        <li><a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a></li>
	<li><a href="http://www.gnu.org/licenses/gpl-2.0.html">http://www.gnu.org/licenses/gpl-2.0.html</a></li>
	<li><a href="http://www.gnu.org/licenses/gpl-3.0.html">http://www.gnu.org/licenses/gpl-3.0.html</a></li>
</ol>
</li>
	<li>There is currently no way to add this magical mapping to your custom license templates. If you have an OSS license that you would like be added, file an issue at netbeans.org (with the license template attached and url pointing to the license on the web.</li>
       <li>To have the license header added for your in-house non-OSS project, you can create a NetBeans module that will add the license header template declaratively. Ask me for details.</li>
</ul>

<p>UPDATE: I've actually forgot to mention the name of the property to put in the pom.xml file. it's "netbeans.hint.license".</p>]]>
        
    </content>
</entry>

<entry>
    <title>The little things</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2010/02/the-little-things.html" />
    <id>tag:blogs.codehaus.org,2010:/people/mkleint//131.1831</id>

    <published>2010-02-28T14:33:49Z</published>
    <updated>2010-02-28T15:17:58Z</updated>

    <summary><![CDATA[A way back I've written myself a small application to make geocaching easier to manage. It downloads geocache information, converts to gpx format (some sort of xml understood by the GPS device) and then writes to the GPS device - (Garmin Colorado) via USB. It's not really an application I'm proud of, it's full of hacks and the UI is also of stone age usability, but so far I wasn't able to find a better one. Anyway, my wife suggested I install the app on her computer as well, so that she can upload a cache even when I'm not around. I've always run the app from command line or from the IDE, but that's not something I want my wife to go though :) Since she has a Mac laptop, I've looked into how to generate a Mac natively executable binary. It was easier than I though thanks to the wide and deep reservoir of Apache Maven plugins around. There is one for Mac applications as well - osxappbundle-maven-plugin. A simple copy&amp;paste into my pom and there we have a nice geocaching.dmg file with the geocaching.app application. Great. The biggest obstacle turned out to be creation of the *.icns file with a custom icon for the application. It's created by the Icon Composer application (at /Developer/Applications/Utilities/Icon Composer) and it took me a while that it doesn't accept gif files but tiff image files. It's great when things just work and work in 15 minutes time.. And we've visited this geocache afterwards. A great trip....]]></summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    <category term="apachemaven" label="Apache Maven" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="geocaching" label="Geocaching" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gps" label="GPS" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>A way back I've written myself a small application to make <a href="http://www.geocaching.com">geocaching</a> easier to manage. It downloads geocache information, converts to gpx format (some sort of xml understood by the GPS device) and then writes to the GPS device - (<a href="https://buy.garmin.com/shop/shop.do?cID=145&amp;pID=11019">Garmin Colorado</a>) via USB. It's not really an application I'm proud of, it's full of hacks and the UI is also of stone age usability, but so far I wasn't able to find a better one.<br />
Anyway, my wife suggested I install the app on her computer as well, so that she can upload a cache even when I'm not around. I've always run the app from command line or from the IDE, but that's not something I want my wife to go though :) Since she has a Mac laptop, I've looked into how to generate a Mac natively executable binary. It was easier than I though thanks to the wide and deep reservoir of <a class="zem_slink" href="http://maven.apache.org" title="Apache Maven" rel="homepage">Apache Maven</a> plugins around. There is one for Mac applications as well - <a href="http://mojo.codehaus.org/osxappbundle-maven-plugin/examples/simple.html">osxappbundle-maven-plugin</a>. A simple copy&amp;paste into my pom and there we have a nice geocaching.dmg file with the geocaching.app application. Great. The biggest obstacle turned out to be creation of the *.icns file with a custom icon for the application. It's created by the Icon Composer application (at /Developer/Applications/Utilities/Icon Composer) and it took me a while that it doesn't accept gif files but tiff image files. It's great when things just work and work in 15 minutes time..</p>

<p>And we've visited <a href="http://www.geocaching.com/seek/cache_details.aspx?guid=0ca99d24-e362-4d3b-ade3-fbcfbd022f4f">this geocache</a> afterwards. A great trip.</p>

<p></p>

<div class="zemanta-pixie" style="margin-top:10px;height:15px"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0607c422-1151-4c87-90b1-5d81a1ece9e8/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=0607c422-1151-4c87-90b1-5d81a1ece9e8" alt="Reblog this post [with Zemanta]" style="border:none;float:right"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>Maven snapshot repository for NetBeans daily builds</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2010/01/maven-snapshot-repository-for-.html" />
    <id>tag:blogs.codehaus.org,2010:/people/mkleint//131.1830</id>

    <published>2010-01-30T08:20:12Z</published>
    <updated>2010-01-30T08:24:16Z</updated>

    <summary>.. is at http://bits.netbeans.org/netbeans/trunk/maven-snapshot/....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>.. is at <a href="http://bits.netbeans.org/netbeans/trunk/maven-snapshot/">http://bits.netbeans.org/netbeans/trunk/maven-snapshot/</a>. </p>]]>
        
    </content>
</entry>

<entry>
    <title>Using annotations in Maven NetBeans Module projects</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2010/01/annotations-in-maven-netbeans-.html" />
    <id>tag:blogs.codehaus.org,2010:/people/mkleint//131.1829</id>

    <published>2010-01-21T13:24:27Z</published>
    <updated>2010-01-21T13:45:21Z</updated>

    <summary><![CDATA[Since version 6.8 NetBeans provides annotations to simplify various NetBeans platform API usages. So you can register a ServiceProvider and the build process generates the proper META-INF/service entry. Other annotations are capable of generating layer file entries. So far this didn't work in Maven based project due to MCOMPILER-98 bug of the maven-compiler-plugin. The issue is fixed now, but it will take time to propagate into a released version of the compiler plugin. Here is how to enable it in your Apache Maven projects now. Open your netbeans module project pom.xml file (or the parent pom of your module projects to configure all modules) and add the following maven-compiler-plugin configuration: &lt;plugin&gt; &nbsp;&nbsp; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &nbsp;&nbsp; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &nbsp;&nbsp; &lt;version&gt;2.1&lt;/version&gt; &nbsp;&nbsp; &lt;configuration&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;source&gt;1.6&lt;/source&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;target&gt;1.6&lt;/target&gt; &nbsp;&nbsp; &lt;/configuration&gt; &nbsp;&nbsp; &lt;dependencies&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;dependency&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;plexus-compiler-javac&lt;/artifactId&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;version&gt;1.7-SNAPSHOT&lt;/version&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/dependency&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;dependency&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;plexus-compiler-api&lt;/artifactId&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;version&gt;1.7-SNAPSHOT&lt;/version&gt; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/dependency&gt; &nbsp;&nbsp; &lt;/dependencies&gt; &lt;/plugin&gt; Since you are depending on unreleased snapshots, a snapshot repository declaration pointing to Plexus snapshot repository is necessary. Afterward you are ready to use the annotations in NetBeans APIs. Enjoy!...]]></summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    <category term="apachemaven" label="Apache Maven" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="java" label="Java" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="netbeans" label="NetBeans" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Since version 6.8 NetBeans provides annotations to simplify various NetBeans platform API usages. So you can register a <a href="http://bits.netbeans.org/dev/javadoc/org-openide-util-lookup/org/openide/util/lookup/ServiceProvider.html">ServiceProvider</a> and the build process generates the proper META-INF/service entry. Other annotations are capable of generating layer file entries. So far this didn't work in Maven based project due to <a href="http://jira.codehaus.org/browse/MCOMPILER-98">MCOMPILER-98</a> bug of the maven-compiler-plugin. The issue is fixed now, but it will take time to propagate into a released version of the compiler plugin. Here is how to enable it in your Apache Maven projects now.</p>

<p>Open your netbeans module project pom.xml file (or the parent pom of your module projects to configure all modules)<br />
and add the following maven-compiler-plugin configuration:<br />
<code><br />
         &lt;plugin&gt;<br />
         &nbsp;&nbsp;           &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
         &nbsp;&nbsp;           &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br />
          &nbsp;&nbsp;          &lt;version&gt;2.1&lt;/version&gt;<br />
          &nbsp;&nbsp;          &lt;configuration&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;              &lt;source&gt;1.6&lt;/source&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;              &lt;target&gt;1.6&lt;/target&gt;<br />
          &nbsp;&nbsp;          &lt;/configuration&gt;<br />
           &nbsp;&nbsp;         &lt;dependencies&gt;<br />
            &nbsp;&nbsp;&nbsp;&nbsp;            &lt;dependency&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  &lt;artifactId&gt;plexus-compiler-javac&lt;/artifactId&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  &lt;version&gt;1.7-SNAPSHOT&lt;/version&gt;<br />
          &nbsp;&nbsp;&nbsp;&nbsp;              &lt;/dependency&gt;<br />
           &nbsp;&nbsp;&nbsp;&nbsp;             &lt;dependency&gt;<br />
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                 &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;<br />
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                 &lt;artifactId&gt;plexus-compiler-api&lt;/artifactId&gt;<br />
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                 &lt;version&gt;1.7-SNAPSHOT&lt;/version&gt;<br />
             &nbsp;&nbsp;&nbsp;&nbsp;           &lt;/dependency&gt;<br />
             &nbsp;&nbsp;       &lt;/dependencies&gt;<br />
                &lt;/plugin&gt;<br />
</code></p>

<p>Since you are depending on unreleased snapshots, a snapshot repository declaration pointing to <a href="http://oss.repository.sonatype.org/content/repositories/plexus-snapshots/">Plexus snapshot repository</a> is necessary.</p>

<p>Afterward you are ready to use the annotations in NetBeans APIs. Enjoy!</p>

<p></p>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/e37c84cb-1089-44f4-bcb9-602c5554e86b/" title="Reblog this post [with Zemanta]"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=e37c84cb-1089-44f4-bcb9-602c5554e86b" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>Task oriented UI for Maven projects</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/08/task-oriented-ui-for-maven-pro.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1811</id>

    <published>2009-08-06T09:05:25Z</published>
    <updated>2009-12-11T22:42:24Z</updated>

    <summary>Configuring Maven projects and adhering to the declared best practices can be sometimes tough. I&apos;ve tried to come up with a solution based on the IDE and task oriented UI for that. How does it look like? First there are code generators directly in the pom.xml file (In NetBeans accessible from the editor&apos;s popup menu, main menu or via Alt-Insert shortcut) For each supported usecase there is one item that either appears all the time, or only when the relevant configuration is not present. Eg. If the IDE figures you already have the Maven Site, it shall not offer you to generate it. Second there is a new panel into the Project Properties dialog that does approximately the same thing, It&apos;s called Generators and lists the available tasks. It will also show the ones that are recognized to be present in the project already. Ideally some generators shall appear on other panels (like Scala or Groovy language configuration which shall be placed in the Sources panel) but there&apos;s only APIs to plug new panels to the dialog, not into existing ones. And what do the actual generators do? They add dependencies and/or plugins to your pom. Eventually some basic configuration. It&apos;s smart enough to figure that you have the dependency/plugin version managed already and omit the version in that case. At the same time for &quot;pom&quot; packaged projects it will prefer adding the plugin/dependency management section as well. If you already define the plugin or dependency, it will skip it during generation. So it should be smarter than plain copy &amp; paste from the maven plugin&apos;s website. And what generators are currently implemented? Maven SIte - it creates the site.xml file for you, adds and configures some basic report plugins. Scala - creates the scala source roots and adds the scala-library as dependency, configures the maven-scala-plugin. Please note that in order to have the Scala editor support you will need to install the Scala related NetBeans modules. Groovy - as as with Scala, source roots, dependency and plugin config to get started with writing your projects with Groovy Javarebel profile that adds the necessary configuration for running with Javarebel jvm agent You have ideas for more? Please add your suggestions at the comment area. And where can you get the thing? It&apos;s available from kenai.com, should work in 6.7+ (thus also in 6.7.1 and 6.8M1). Please note that some Scala/Groovy integration fixes only appear in 6.8M1. There&apos;s 2 zip files. Both are approx same quality, the latest one is a snapshot only though as it&apos;s using currently unreleased 2.8.0-SNAPSHOT of Scala. Yes, this NetBeans plugin is written in Scala :)...</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Configuring Maven projects and adhering to the declared best practices can be sometimes tough. I've tried to come up with a solution based on the IDE  and task oriented UI for that. <br />
How does it look like? First there are code generators directly in the pom.xml file (In NetBeans accessible from the editor's popup menu, main menu or via Alt-Insert shortcut) For each supported usecase there is one item that either appears all the time, or only when the relevant configuration is not present. Eg. If the IDE figures you already have the Maven Site, it shall not offer you to generate it.<br />
<img src="http://codehaus.org/~mkleint/generators1.png"/><br />
Second there is a new panel into the Project Properties dialog that does approximately the same thing, It's called Generators and lists the available tasks. It will also show the ones that are recognized to be present in the project already. Ideally some generators shall appear on other panels (like Scala or Groovy language configuration which shall be placed in the Sources panel) but there's only APIs to plug new panels to the dialog, not into existing ones.<br />
<img src="http://codehaus.org/~mkleint/generators2.png"/></p>

<p>And what do the actual generators do? They add dependencies and/or plugins to your pom. Eventually some basic configuration. It's smart enough to figure that you have the dependency/plugin version managed already and omit the version in that case. At the same time for "pom" packaged projects it will prefer adding the plugin/dependency management section as well. If you already define the plugin or dependency, it will skip it during generation. So it should be smarter than plain copy & paste from the maven plugin's website. </p>

<p>And what generators are currently implemented?<br />
<ul><br />
<li>Maven SIte - it creates the site.xml file for you, adds and configures some basic report plugins.</li><br />
<li>Scala - creates the scala source roots and adds the scala-library as dependency, configures the maven-scala-plugin. Please note that in order to have the Scala editor support you will need to install the Scala related NetBeans modules.</li><br />
<li>Groovy - as as with Scala, source roots, dependency and plugin config to get started with writing your projects with Groovy </li><br />
<li>Javarebel profile that adds the necessary configuration for running with Javarebel jvm agent</li><br />
<li>You have ideas for more? Please add your suggestions at the comment area.</li><br />
</ul></p>

<p>And where can you get the thing? It's available from <br />
<a href="http://kenai.com/projects/nb-maven-generators/downloads">kenai.com</a>, should work in 6.7+ (thus also in 6.7.1 and 6.8M1). Please note that some Scala/Groovy integration fixes only appear in 6.8M1. There's 2 zip files. Both are approx same quality, the latest one is a snapshot only though as it's using currently unreleased 2.8.0-SNAPSHOT of Scala. Yes, this NetBeans plugin is written in Scala :)<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>NB 6.7.1 - 20 Maven related bugs fixed</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/07/nb-671-20-maven-related-bugs-f.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1809</id>

    <published>2009-07-28T05:42:46Z</published>
    <updated>2009-12-11T22:42:23Z</updated>

    <summary>A new version of NetBeans is out, 6.7.1 - a bugfix release. Among other things it contains 20 bugfixes in the Apache Maven support. Please upgrade....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>A new version of NetBeans is out, 6.7.1 - a bugfix release. Among other things it contains <a href="http://www.netbeans.org/issues/buglist.cgi?component=maven&issue_status=RESOLVED&issue_status=VERIFIED&issue_status=CLOSED&email1=&emailtype1=exact&emailassigned_to1=1&email2=&emailtype2=exact&emailreporter2=1&issueidtype=include&issue_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&issue_file_loc=&issue_file_loc_type=substring&status_whiteboard=67patch1-verified&status_whiteboard_type=substring&keywords=&keywords_type=anytokens&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&namedcmd=all_vcs&newqueryname=&order=Reuse+same+sort+as+last+time&Submit+query=Submit+query">20 bugfixes</a> in the Apache Maven support. Please upgrade.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Few notes on using maven projects at kenai.com</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/07/few-notes-on-using-maven-proje.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1807</id>

    <published>2009-07-24T12:08:06Z</published>
    <updated>2009-12-11T22:42:23Z</updated>

    <summary>Because kenai.com doesn&apos;t provide any unified deployment vehicle for maven projects yet, I&apos;ve tried the way suggested by Fabrizio Guidici. The following comments might help other who also attempt to do so. I&apos;ve tried to perform a release of a set of maven projects at http://kenai.com/projects/nb-maven-generators if you are using mercurial as the version control of choice, then release:prepare will fail for you if the mercurial root doesn&apos;t contain the root pom.xml file. I had the projects in a subdirectory and the checkout/clone that is part of the release:prepare goal didn&apos;t find it then. I suppose that&apos;s a generic issue with mercurial+maven-scm-plugin. It attempts to tag the project, but mercurial is only capable of tagging and cloning the whole repository. I haven&apos;t tried, but I suppose releasing just one submodule might not be possible If your username at kenai contains a special character, like @ in my case (milos.kleint@sun.com), you need to encode the character when running mvn -Dusername=milos.kleint%40sun.com -Dpassword= release:prepare For a complete list of url encodings, see this explanatory page When doing release:perform afterward, the forked maven build needed me to confirm credentials of the svn release repository. Unfortunately the forked maven instance within release:perform doesn&apos;t have the input streams connected correctly and therefore I could not confirm the credentials are ok. A workaround I found was to perform mvn deploy:deploy-file, confirm credentials and then cancel. Finally, when deploying you need to pass the username and password for the svn wagon extension via the ~/.m2/settings.xml file. See details about the exact syntax. After a few try&amp;error cycles, I finally managed to perform the release correctly. Hope that helps....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Because <a href="http://kenai.com">kenai.com</a> doesn't provide any unified deployment vehicle for maven projects yet, I've tried the way suggested by <a href="http://java.dzone.com/tips/using-maven-repository-kenai">Fabrizio Guidici</a>. The following comments might help other who also attempt to do so.</p>

<p>I've tried to perform a release of a set of maven projects at <a href="http://kenai.com/projects/nb-maven-generators">http://kenai.com/projects/nb-maven-generators</a><br />
<ul><br />
<li>if you are using <a href="http://mercurial.selenic.com/wiki/">mercurial</a> as the version control of choice, then release:prepare will fail for you if the mercurial root doesn't contain the root pom.xml file. I had the projects in a subdirectory and the checkout/clone that is part of the release:prepare goal didn't find it then. I suppose that's a generic issue with mercurial+maven-scm-plugin. It attempts to tag the project, but mercurial is only capable of tagging and cloning the whole repository. I haven't tried, but I suppose releasing just one submodule might not be possible</li><br />
<li>If your username at kenai contains a special character, like @ in my case (milos.kleint@sun.com), you need to encode the character when running <br />
<code>mvn -Dusername=milos.kleint%40sun.com -Dpassword=<thepass> release:prepare</code><br />
For a complete list of url encodings, see <a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm">this explanatory page</a><br />
<li>When doing release:perform afterward, the forked maven build needed me to confirm credentials of the svn release repository. Unfortunately the forked maven instance within release:perform doesn't have the input streams connected correctly and therefore I could not confirm the credentials are ok. A workaround I found was to perform mvn deploy:deploy-file, confirm credentials and then cancel. </li><br />
<li>Finally, when deploying you need to pass the username and password for the svn wagon extension via the ~/.m2/settings.xml file. See <a href="http://maven.apache.org/settings.html#Servers">details</a> about the exact syntax.<br />
</ul></p>

<p>After a few try&error cycles, I finally managed to perform the release correctly. Hope that helps.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Quick tip: Expressions in Maven dependency declarations</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/07/quick-tip-expressions-in-maven.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1806</id>

    <published>2009-07-10T09:21:30Z</published>
    <updated>2009-12-11T22:42:23Z</updated>

    <summary>As the canonical Maven book suggests, you should use $[foo.bar.version} property expressions when you have multiple, related artifacts with the same version. Then you are able to upgrade all the dependencies consistently with minimal effort. The NetBeans IDE 6.7 supports this pattern in the Add Dependency dialog. You can invoke that dialog from the Add Dependency action on project&apos;s Libraries node in Projects view, or from the pom.xml editor via Insert Code (Alt-Insert) editor action. The Version field completion includes all *.version properties defined in the project (or any of the parent) and offers them as expressions in form ${*.properties} That way you can keep your dependencies in sync right from the NetBeans UI. In future 6.8, we also replace the GroupId and Version values with ${project.groupId} and ${project.version} if both the groupid and version match those of the current project. Again, a practise suggested by the Maven book....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>As the canonical Maven book <a href="http://www.sonatype.com/books/maven-book/reference/optimizing-sect-dependencies.html">suggests</a>, you should use $[foo.bar.version} property expressions when you have multiple, related artifacts with the same version. Then you are able to upgrade all the dependencies consistently with minimal effort.</p>

<p>The NetBeans IDE 6.7 supports this pattern in the Add Dependency dialog. You can invoke that dialog from the Add Dependency action on project's Libraries node in Projects view, or from the pom.xml editor via Insert Code (Alt-Insert) editor action.<br />
The Version field completion includes all *.version properties defined in the project (or any of the parent) and offers them as expressions in form ${*.properties}<br />
<img src="http://codehaus.org/~mkleint/addversionasexpr.png"/><br />
That way you can keep your dependencies in sync right from the NetBeans UI.</p>

<p>In future 6.8, we also replace the GroupId and Version values with ${project.groupId} and ${project.version} if both the groupid and version match those of the current project. Again, a practise suggested by the Maven book.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Maven, NetBeans platform, JavaRebel</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/07/maven-netbeans-platform-javare.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1805</id>

    <published>2009-07-01T12:59:07Z</published>
    <updated>2009-12-11T22:42:23Z</updated>

    <summary>When I was playing with JavaRebel in April, it was not possible to use JavaRebel with the NetBeans platform. Basically because the module system is just another container and for each container you need a JavaRebel plugin. The guys at Zeroturnaround wrote the plugin a few weeks back (thanks!) so I&apos;ve downloaded the nightly build and tried to experiment a bit. I&apos;ve also worked some more on Compile on Save support for 6.8, so I wanted to test how far we&apos;ve got with #161337. Here&apos;s the result....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>When I was <a href="http://blogs.codehaus.org/people/mkleint/archives/001795_appframework_maven_javarebel_and_netbeans.html">playing with JavaRebel</a> in April, it was not possible to use JavaRebel with the NetBeans platform. Basically because the module system is just another container and for each container you need a JavaRebel plugin. The guys at Zeroturnaround wrote the plugin a few weeks back (thanks!) so I've downloaded the nightly build and tried to experiment a bit. I've also worked some more on <a href="">Compile on Save</a> support for 6.8, so I wanted to test how far we've got with <a href="http://www.netbeans.org/issues/show_bug.cgi?id=161337">#161337</a>. Here's the result.<br />
</p>]]>
        <![CDATA[<p>I've been using latest NetBeans dev builds, not 6.7. And the latest nightly <a href="http://www.zeroturnaround.com/javarebel/download/">JavaRebel</a> from Zeroturnaround.com</p>

<p>1. create a new maven nb platform based app from the archetype:<br />
GroupId: org.codehaus.mojo.archetypes<br />
ArtifactId: netbeans-platform-app-archetype<br />
Version: 1.1</p>

<p>In the simple module subproject, define a new simple action (via New Action wizard) that will reside in toolbar and main menu.</p>

<p>2. add a profile for javarebel in the root pom.xml<br />
<pre>&lt;profile&gt;<br />
            &lt;id&gt;rebel&lt;/id&gt;<br />
            &lt;pluginRepositories&gt;<br />
                &lt;pluginRepository&gt;<br />
                    &lt;id&gt;zt-repo&lt;/id&gt;<br />
                    &lt;name&gt;Zero turnaround repo&lt;/name&gt;<br />
                    &lt;url&gt;http://repos.zeroturnaround.com/maven2&lt;/url&gt;<br />
                &lt;/pluginRepository&gt;<br />
            &lt;/pluginRepositories&gt;<br />
            &lt;build&gt;<br />
                &lt;plugins&gt;<br />
                    &lt;plugin&gt;<br />
                        &lt;groupId&gt;org.zeroturnaround&lt;/groupId&gt;<br />
                        &lt;artifactId&gt;javarebel-maven-plugin&lt;/artifactId&gt;<br />
                        &lt;version&gt;1.0.5&lt;/version&gt;<br />
                        &lt;executions&gt;<br />
                            &lt;execution&gt;<br />
                                &lt;id&gt;generate-rebel-xml&lt;/id&gt;<br />
                                &lt;phase&gt;process-resources&lt;/phase&gt;<br />
                                &lt;goals&gt;<br />
                                    &lt;goal&gt;generate&lt;/goal&gt;<br />
                                &lt;/goals&gt;<br />
                            &lt;/execution&gt;<br />
                        &lt;/executions&gt;<br />
                        &lt;configuration&gt;<br />
                            &lt;packaging&gt;jar&lt;/packaging&gt;<br />
                        &lt;/configuration&gt;<br />
                    &lt;/plugin&gt;<br />
                &lt;/plugins&gt;<br />
            &lt;/build&gt;<br />
        &lt;/profile&gt;</pre></p>

<p>The important part here is the packaging parameter which we set to "jar" to have the netbeans modules (which have packaging "nbm" - unknown to the plugin) processed as plain jars.</p>

<p>3. in project properties dialog enable Configurations on the root project and activate the rebel profile. Then perform a build, all modules that are part of the project shall have the rebel.xml file generated now.</p>

<p>4. In Tools/Variables dialog, define a variable REBEL that points to the directory where you extracted JavaRebel to. </p>

<p>5. In the properties dialog of the nbm-application project, configure the startup parameters of the Run project action binding to include javarebel agent:<br />
<code>netbeans.run.params=-J-noverify -J-javaagent:${REBEL}/javarebel.jar -J-Drebel.log=true</code></p>

<p>Please Note: In 6.7, steps 4+5 won't work as described and you have to put the absolute path the javarebel jar in the action binding. Since it's written to the nbactions.xml file in the project basedir, it's rather inconvenient since you want to share that file in version control.</p>

<p>6. Now you can run the application. You can verify in the output of the maven build that the javarebel agent was started. You should have a basic Nb platform application started with the new action in the main menu. It doesn't do anything yet, let's change it. Note: keep the platform application running, don't exit.</p>

<p>7. Let's put something simple and visible into the action's <code>performAction()</code> method:</p>

<p><code><br />
DialogDescriptor dd = new DialogDescriptor(new JLabel("foo"), "bar");<br />
DialogDisplayer.getDefault().notify(dd);<br />
</code></p>

<p>Save the file. Unfortunately the class didn't get compiled on save, we will need to go to the module's project properties Compile panel and turn "Compile on Save" on for application sources. Now let's change and save the action class again and you should get the class compiled. Switch to the running application and trigger the action. You should get a dialog showing up now. Hurray!</p>

<p>Please note that in 6.7, you will have to add an maven-antrun-plugin snippet as described in the <a href="http://blogs.codehaus.org/people/mkleint/archives/001795_appframework_maven_javarebel_and_netbeans.html">previous blog entry</a>.</p>

<p>Note to self: It would be nice if the CoS support in the IDE would recognize the rebel.xml file in the target/classes folder and just automatically assume CoS shall be on, without additional configuration in the projects.</p>

<p>8. Unfortunately not everything is so bright, some things don't get propagated, like resources. If you try replace the explicit strings with<br />
<code><br />
org.openide.util.NbBundle.getMessage(MyAction.class, "LBL_foo");<br />
</code> or <code><br />
java.util.ResourceBundle.getBundle("com/mkleint/platformwithjavarebel/Bundle").getString("LBL_foo")<br />
</code><br />
you end up with MissingResourceException. First I though it's caused by some caching in the ResourceBundle or NbBundle classes, but even if you create a new class in new package that was not touched before by the app, it will always just look for the bundle file in the jar, and never in the sources or output folder, which is strange because the javarebel log claims to watch the target/classes and src/main/resources folders when you start up the application. </p>

<p>9. I haven't even tried but anything that has to do with layer files, META-INF/services registration and annotations will not work either. I guess it could be added to the JavaRebel's netbeans plugin. Like dropping the various caches and reload everything when some of the significant files changes or appears, however it wil not work without having the resource problems mentioned in bullet 8.</p>

<p>Still, even with these limitations, the development cycle has been shortened significantly. Someone volunteer to add javarebel file generation to the Netbeans.org ant scripts?</p>]]>
    </content>
</entry>

<entry>
    <title>NB 6.7 binaries in Maven repository</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/07/nb-67-binaries-in-maven-reposi.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1804</id>

    <published>2009-07-01T08:08:43Z</published>
    <updated>2009-12-11T22:42:23Z</updated>

    <summary><![CDATA[I've uploaded the Netbeans 6.7 final artifacts to the Maven repository at http://bits.netbeans.org/maven2/. It contains the module jars, NBM files, javadoc and source jars and other artifacts relevant to 6.7 release. Please note that when upgrading your NetBeans platform application from 6.5 to 6.7, you need to increase the version of all artifacts from RELEASE65 to RELEASE67 and also in your nbm-application project, change the dependency from org.netbeans.cluster:platform9 to org.netbeans.cluster:platform10. The artifactId of the platform cluster has changed as the cluster version was increased. (Not sure what meaningful purpose the cluster numbering serves, but that's a different story) &lt;dependency&gt; &lt;groupId&gt;org.netbeans.cluster&lt;/groupId&gt; &lt;artifactId&gt;platform10&lt;/artifactId&gt; &lt;version&gt;${netbeans.version}&lt;/version&gt; &lt;type&gt;pom&lt;/type&gt; &lt;/dependency&gt; Please note that the current 3.0 version of the nbm-maven-plugin might have problems with NetBeans 6.7 . A new version of the plugin will appear shortly....]]></summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>I've uploaded the Netbeans 6.7 final artifacts to the Maven repository at <a href="http://bits.netbeans.org/maven2/">http://bits.netbeans.org/maven2/</a>. It contains the module jars, NBM files, javadoc and source jars and other artifacts relevant to 6.7 release.</p>

<p>Please note that when upgrading your NetBeans platform application from 6.5 to 6.7, you need to increase the version of all artifacts from <b>RELEASE65</b> to <b>RELEASE67</b> and also in your <b>nbm-application</b> project, change the dependency from <b>org.netbeans.cluster:platform9</b> to <b>org.netbeans.cluster:platform10</b>. The artifactId of the platform cluster has changed as the cluster version was increased. (Not sure what meaningful purpose the cluster numbering serves, but that's a different story)</p>

<pre>
        &lt;dependency&gt;
            &lt;groupId&gt;org.netbeans.cluster&lt;/groupId&gt;
            &lt;artifactId&gt;platform10&lt;/artifactId&gt;
            &lt;version&gt;${netbeans.version}&lt;/version&gt;
            &lt;type&gt;pom&lt;/type&gt;
        &lt;/dependency&gt;
</pre>

<p>Please note that the current 3.0 version of the nbm-maven-plugin might <a href="http://jira.codehaus.org/browse/MNBMODULE-55">have problems</a> with NetBeans 6.7 . A new version of the plugin will appear shortly.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Appframework, Maven, JavaRebel and NetBeans</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/04/appframework-maven-javarebel-a.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1795</id>

    <published>2009-04-27T14:08:40Z</published>
    <updated>2009-12-11T22:42:22Z</updated>

    <summary><![CDATA[I've tried to play around with various setups of Maven projects in NetBeans, testing "Compile On Save" primarily. The traditional CoS in NetBeans will redeploy your webapp or quickly rerun the application (without recompiling the sources). I've tested a bit more IDE independent setup here, described in few simple steps, hopefully useful to someone. 0. Install the latest dev binaries of upcoming NetBeans 6.7 (future beta or existing M3 shall also do, no guarantees for 6.5). Also download the Javarebel application from zeroturnaround.com 1. First take the appframework archetype and create a sample project we will be playing around. In Netbeans 6.7 builds, the archetype shall be available in the New Maven project creation wizard in a privileged location. 2. Open the pom.xml file for the project and add a profile for JavaRebel there. &lt;profile&gt; &lt;id&gt;rebel&lt;/id&gt; &lt;pluginRepositories&gt; &lt;pluginRepository&gt; &lt;id&gt;zt-repo&lt;/id&gt; &lt;name&gt;Zero turnaround repo&lt;/name&gt; &lt;url&gt;http://repos.zeroturnaround.com/maven2&lt;/url&gt; &lt;/pluginRepository&gt; &lt;/pluginRepositories&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.zeroturnaround&lt;/groupId&gt; &lt;artifactId&gt;javarebel-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0.2&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;generate-rebel-xml&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;generate&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt; &lt;version&gt;1.3&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;run&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;tasks&gt; &lt;echo file="${project.build.outputDirectory}/.netbeans_automatic_build"&gt;Generated by maven build for javarebel in netbeans.&lt;/echo&gt; &lt;/tasks&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; The configuration performs 2 tasks. It generates the rebel.xml file required by the Javarebel agent to find the output folders of the project in the resulting running application. Second, it generates a file in the output area of the project that tells NetBeans java support to copy the class files on saving. 3. Now you can Enable Configurations in the Project properties, activate the rebel profile there and for that profile/configuration, add additional VM options for running the application (the Run panel in project properties dialog) For me it was: -noverify -javaagent:/home/mkleint/javatools/javarebel/javarebel.jar 4. Build & Run the Application. If you've done things right, you should see in the output that the JavaRebel agent is running.If you open the application's AboutBox form and move stuff around, you should be able to see the changed propagated on Save in the IDE. Oups, You actually won't :) The showAboutBox() method the View class is caching the created about box, therefore the old layout persists. Once you remove the caching (even already in running application), you will see any changes in the AboutBox in the running application immediately. 5. Enjoy....]]></summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>I've tried to play around with various setups of Maven projects in NetBeans, testing "Compile On Save" primarily. The traditional CoS in NetBeans will redeploy your webapp or quickly rerun the application (without recompiling the sources). I've tested a bit more IDE independent setup here, described in few simple steps, hopefully useful to someone.</p>

<p>0. Install the latest <a href="http://bits.netbeans.org/download/trunk/nightly/latest/">dev binaries</a> of upcoming NetBeans 6.7 (future beta or existing M3 shall also do, no guarantees for 6.5). Also download the Javarebel application from <a href="http://www.zeroturnaround.com/javarebel/download/">zeroturnaround.com</a></p>

<p>1. First take the <a href="http://repo2.maven.org/maven2/org/codehaus/mojo/archetypes/appframework/1.0/"> appframework archetype</a> and create a sample project we will be playing around. In Netbeans 6.7 builds, the archetype shall be available in the New Maven project creation wizard in a privileged location.</p>

<p>2. Open the pom.xml file for the project and add a profile for JavaRebel there.<br />
<pre><br />
   &lt;profile&gt;<br />
    &lt;id&gt;rebel&lt;/id&gt;<br />
    &lt;pluginRepositories&gt;<br />
        &lt;pluginRepository&gt;<br />
            &lt;id&gt;zt-repo&lt;/id&gt;<br />
            &lt;name&gt;Zero turnaround repo&lt;/name&gt;<br />
            &lt;url&gt;http://repos.zeroturnaround.com/maven2&lt;/url&gt;<br />
        &lt;/pluginRepository&gt;<br />
    &lt;/pluginRepositories&gt;<br />
    &lt;build&gt;<br />
        &lt;plugins&gt;<br />
            &lt;plugin&gt;<br />
                &lt;groupId&gt;org.zeroturnaround&lt;/groupId&gt;<br />
                &lt;artifactId&gt;javarebel-maven-plugin&lt;/artifactId&gt;<br />
                &lt;version&gt;1.0.2&lt;/version&gt;<br />
                &lt;executions&gt;<br />
                    &lt;execution&gt;<br />
                        &lt;id&gt;generate-rebel-xml&lt;/id&gt;<br />
                        &lt;phase&gt;process-resources&lt;/phase&gt;<br />
                        &lt;goals&gt;<br />
                            &lt;goal&gt;generate&lt;/goal&gt;<br />
                        &lt;/goals&gt;<br />
                    &lt;/execution&gt;<br />
                &lt;/executions&gt;<br />
                &lt;configuration&gt;<br />
                &lt;/configuration&gt;<br />
            &lt;/plugin&gt;<br />
            &lt;plugin&gt;<br />
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
                &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;<br />
                &lt;version&gt;1.3&lt;/version&gt;<br />
                &lt;executions&gt;<br />
                    &lt;execution&gt;<br />
                        &lt;id&gt;run&lt;/id&gt;<br />
                        &lt;phase&gt;process-resources&lt;/phase&gt;<br />
                        &lt;goals&gt;<br />
                            &lt;goal&gt;run&lt;/goal&gt;<br />
                        &lt;/goals&gt;<br />
                    &lt;/execution&gt;<br />
                &lt;/executions&gt;<br />
                &lt;configuration&gt;<br />
                    &lt;tasks&gt;<br />
                        &lt;echo file="${project.build.outputDirectory}/.netbeans_automatic_build"&gt;Generated by maven build for javarebel in netbeans.&lt;/echo&gt;<br />
                    &lt;/tasks&gt;<br />
                &lt;/configuration&gt;<br />
            &lt;/plugin&gt;<br />
        &lt;/plugins&gt;<br />
    &lt;/build&gt;<br />
&lt;/profile&gt;<br />
</pre></p>

<p>The configuration performs 2 tasks. It generates the rebel.xml file required by the Javarebel agent to find the output folders of the project in the resulting running application. Second, it generates a file in the output area of the project that tells NetBeans java support to copy the class files on saving.</p>

<p>3. Now you can Enable Configurations in the Project properties, activate the <b>rebel</b> profile there and for that profile/configuration, add additional VM options for running the application (the Run panel in project properties dialog)<br />
For me it was:<br />
<pre><br />
-noverify -javaagent:/home/mkleint/javatools/javarebel/javarebel.jar<br />
</pre></p>

<p>4. Build & Run the Application. If you've done things right, you should see in the output that the JavaRebel agent is running.If you open the application's AboutBox form and move stuff around, you should be able to see the changed propagated on Save in the IDE. Oups, You actually won't :) The <b>showAboutBox()</b> method the View class is caching the created about box, therefore the old layout persists. Once you remove the caching (even already in running application), you will see any changes in the AboutBox in the running application immediately.</p>

<p>5. Enjoy.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Fixing Maven POM inheritance chain</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/04/fixing-maven-pom-inheritance-c.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1789</id>

    <published>2009-04-03T10:31:50Z</published>
    <updated>2009-12-11T22:42:22Z</updated>

    <summary>Whenever you have a Maven project inheriting from a parent POM, you should make sure the parent is accessible from the sources via the project/parent/relativePath element. The default value is &quot;../pom.xml&quot;, the direct parent folder. The sources version will only be used if the coordinates match, of course. Eg. your project/parent /version element value needs to match the parent&apos;s version element. If one of the conditions is not met, you end up resolving the parent POM from repositories defined in the current project. That might be the right thing in some cases, but sometimes it will prevent you from building the project separately (without having built all the parent beforehand) and also loading of the project in the IDE. In NetBeans, this is one of the reasons for the famed &quot;Badly formed Maven project&quot; error message. Even if it resolves properly from repositories, you might end up in with inconsistent data if some of your projects use the parent from local repository and some from sources. A way to double check in NetBeans how your projects resolve is to show the &quot;POM Inheritance&quot; navigator view while having the pom.xml file focused in editor. In this screenshot, I have opened the v3/common/glassfish-api/pom.xml file from the latest GlassFish svn checkout. The navigator view is in the left bottom area. It displays the project&apos;s POM inheritance, the current pom at the top, the direct parent below it and so on. Any parent marked with &quot;(read only&quot;) is only resolvable from local and remote repositories. In this example, that might be fine for the ultimate root (pom - 3), but it&apos;s most likely wrong for any SNAPSHOT parents, like glassfish-parent. PS: The NetBeans 6.7 Milestone 3 is out. Check it out....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>Whenever you have a Maven project inheriting from a parent POM, you should make sure the parent is  accessible from the sources via the project/parent/relativePath element. The default value is "../pom.xml", the direct parent folder. The sources version will only be used if the coordinates match, of course. Eg. your project/parent /version element value needs to match the parent's version element.</p>

<p>If one of the conditions is not met, you end up resolving the parent POM from repositories defined in the current project.  That might be the right thing in some cases, but sometimes it will prevent you from building the project separately (without having built all the parent beforehand) and also loading of the project in the IDE. In NetBeans, this is one of the reasons for the famed "Badly formed Maven project" error message. Even if it resolves properly from repositories, you might end up in with inconsistent data if some of your projects use the parent from local repository and some from sources.</p>

<p>A way to double check in NetBeans how your projects resolve is to show the "POM Inheritance" navigator view while having the pom.xml file focused in editor.<br />
<img src="http://www.codehaus.org/~mkleint/inheritance.png" alt="Sreenshot"/><br />
In this screenshot, I have opened the v3/common/glassfish-api/pom.xml file from the latest <a href="https://glassfish.dev.java.net/">GlassFish</a> svn checkout. The navigator view is in the left bottom area. It displays the project's POM inheritance, the current pom at the top, the direct parent below it and so on. Any parent marked with "(read only") is only resolvable from local and remote repositories. In this example, that might be fine for the ultimate root (pom - 3), but it's most likely wrong for any SNAPSHOT parents, like glassfish-parent.</p>

<p>PS: The NetBeans 6.7 <a href="http://wiki.netbeans.org/NewAndNoteworthyMilestone3NB67">Milestone 3</a> is out. <a href="http://bits.netbeans.org/download/6.7/m3/">Check it out</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Add Maven dependency the easy way</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/03/add-maven-dependency-the-easy.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1775</id>

    <published>2009-03-09T14:46:48Z</published>
    <updated>2009-12-11T22:42:21Z</updated>

    <summary>I&apos;ve added a few additions to the &quot;Add Dependency&quot; dialog in NetBeans 6.7 daily builds (and the upcoming Milestone 3 of 6.7) First, the dependency&apos;s Version field includes all properties defined in the project that end with .version, eg. ${spring.version} as suggested in the Maven Book, Chapter 8.3. Second, I&apos;ve created a new tab called &quot;Open Projects&quot; that lets the user pick from the list of currently opened projects and declare them as dependency of the current project. Enjoy...</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>I've added a few additions to the "Add Dependency" dialog  in NetBeans 6.7 daily builds (and the upcoming Milestone 3 of 6.7)</p>

<p>First, the dependency's Version field includes all properties defined in the project that end with .version, eg. ${spring.version} as suggested in the <a href="http://www.sonatype.com/books/maven-book/reference/optimizing-sect-dependencies.html">Maven Book, Chapter 8.3</a>. </p>

<p><img src="http://www.codehaus.org/~mkleint/addCompletionExpressions.png"/></p>

<p>Second, I've created a new tab called "Open Projects" that lets the user pick from the list of currently opened projects and declare them as dependency of the current project.</p>

<p><img src="http://www.codehaus.org/~mkleint/addCompletionOpenProjects.png"/></p>

<p>Enjoy</p>

<p><br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>NBM Maven Plugin 3.0 released</title>
    <link rel="alternate" type="text/html" href="http://blogs.codehaus.org/people/mkleint/2009/02/nbm-maven-plugin-30-released.html" />
    <id>tag:blogs.codehaus.org,2009:/people/mkleint//131.1766</id>

    <published>2009-02-25T13:25:55Z</published>
    <updated>2009-12-11T22:42:20Z</updated>

    <summary>I&apos;m proud to announce new release of nbm-maven-plugin. The plugin helps with creation and building of NetBeans module projects and NetBeans platform based applications. = New in this release = Support for full lifecycle of the NetBeans platform based applications. Improved runtime dependency generation, now transitive with class usage checks. Better repository content generation for NetBeans.org artifacts, now located at http://bits.netbeans.org/maven2 and contains NetBeans 6.5 binaries only. Please note that the 3.0 version is not compatible with previous 2.6.x releases or 2.7 alphas. Please read the upgrade notes Complete list of issues fixed. There are new archetypes released that work with this version of nbm-maven-plugin: org.codehaus.mojo.archetypes:nbm-archetype:1.1 org.codehaus.mojo.archetypes:netbeans-platform-application-archetype:1.1 It tool a while to get the release out (too long), but now it&apos;s finally here. Please comment, file issues, send patches.. Thanks....</summary>
    <author>
        <name>mkleint</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.codehaus.org/people/mkleint/">
        <![CDATA[<p>I'm proud to announce new release of nbm-maven-plugin. The plugin<br />
helps with creation and building of NetBeans module projects and<br />
NetBeans platform based applications.</p>

<p>= New in this release =<br />
<ul><br />
<li>Support for full lifecycle of the NetBeans platform based applications.<br />
<li>Improved runtime dependency generation, now transitive with class<br />
usage checks.<br />
<li>Better repository content generation for NetBeans.org artifacts, now<br />
located at <a href="http://bits.netbeans.org/maven2">http://bits.netbeans.org/maven2</a> and contains NetBeans 6.5 binaries only.<br />
</ul></p>

<p>Please note that the 3.0 version is not compatible with previous 2.6.x<br />
releases or 2.7 alphas. Please read the <a href="http://mojo.codehaus.org/nbm-maven-plugin/2630upgrade.html">upgrade notes</a><br />
Complete list of <a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&pid=11293&fixfor=14603">issues fixed.</a></p>

<p>There are new archetypes released that work with this version of<br />
nbm-maven-plugin:<br />
org.codehaus.mojo.archetypes:nbm-archetype:1.1<br />
org.codehaus.mojo.archetypes:netbeans-platform-application-archetype:1.1</p>

<p>It tool a while to get the release out (too long), but now it's finally here. Please comment, file issues, send patches.. Thanks.<br />
</p>]]>
        
    </content>
</entry>

</feed>

