<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    m2e(clipse)-wtp 0.12.0 : New & Noteworthy
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/fbricon">Fred Bricon</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/community/tools/blog/2011/05/03/m2eclipse-wtp-0120-new-noteworthy">View the full blog post</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span id="internal-source-marker_0.6966659519821405">So, </span><span id="internal-source-marker_0.6966659519821405">thanks to Igor Fedorenko's last efforts, </span><span id="internal-source-marker_0.6966659519821405">m2eclipse-wtp 0.12.0 is finally out, (update site available at </span><a class="jive-link-external-small" href="http://m2eclipse.sonatype.org/sites/m2e-extras">http://m2eclipse.sonatype.org/sites/m2e-extras</a><span id="internal-source-marker_0.6966659519821405">), bringing the WTP integration with Maven to a whole new level. The complete release notes are available <a class="jive-link-external-small" href="https://issues.sonatype.org/secure/ReleaseNote.jspa?projectId=10310&amp;version=10937">here</a>. However, I wanted to highlight some of the most notable features in this new version, so let&rsquo;s take a quick tour :</span></p><h3><span> </span><span style="color: #666699;">On-the-fly web resource filtering</span></h3><p><span id="internal-source-marker_0.6966659519821405">Maven has this interesting concept of <a class="jive-link-external-small" href="http://(http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html">web resource filtering</a></span><a class="jive-link-anchor-small"> </a> : basically you can add resources existing in non standard directories, into your final web application. Moreover, you can filter these resources to apply, for instance, specific application configuration depending on a maven profile : you can activate some debug options in your web.xml, define development specific parameters in your spring configuration files, use a different css color scheme when you work locally and so forth. <br/>Supported maven web resource filtering features are :</p><ul><li>inclusion/exclusion of resources</li><li>filtering (not activated by default)</li><li>target path (root of the web application by default)</li><li>possibility to use specific properties file filters</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is a sample of maven-war-plugin configuration filtering any xml files under src/main/webapp, using an external filter file :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;plugin&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;groupId&gt;</span>org.apache.maven.plugins<span class="jive-xml-tag">&lt;/groupId&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>maven-war-plugin<span class="jive-xml-tag">&lt;/artifactId&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>2.1.1<span class="jive-xml-tag">&lt;/version&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;configuration&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;webResources&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;filters&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;filter&gt;</span>src/main/filters/dev.properties<span class="jive-xml-tag">&lt;/filter&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/filters&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;resource&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;directory&gt;</span>src/main/webapp<span class="jive-xml-tag">&lt;/directory&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;filtering&gt;</span>true<span class="jive-xml-tag">&lt;/filtering&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;includes&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;include&gt;</span>**/*.xml<span class="jive-xml-tag">&lt;/include&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/includes&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/resource&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/webResources&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/configuration&gt;</span>
<span class="jive-xml-tag">&lt;/plugin&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Note that after adding the webResource configuration to your pom.xml, you need to update the Maven project configuration.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>m2eclipse-wtp 0.12.0 not only supports these features from maven, but goes one step further and brings you on-the-fly filtering : as soon as you save a file included in the <strong>&lt;webResources&gt; </strong>configuration from the maven-war-plugin, filtering is triggered automatically. Couple that with WTP&rsquo;s hot redeployment capabilities, and you can see your changes by just reloading the affected pages in your browser. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>OK, to be fair, that depends on the changed files, actually. If you change the content of your web.xml, or some spring config files, chances are you&rsquo;ll have to restart your application or the server for the changes to be taken in consideration. <br/>The filtered resources are&#160; copied to the project build directory, under <strong>m2e-wtp/web-resources</strong>. You can view the content of this folder directly from the Project Explorer view in eclipse, under the <strong>Web Resources</strong> Node. You can open and compare side by side a raw file and its filtered version, as shown in the following screenshot.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16241/web-resource-filtering-profile1.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16241/450-238/web-resource-filtering-profile1.jpg </span></a></p><p>In the previous example, the dev profile, activated by default (see lower right panel) determines which filter file must be used during filtering. In this case, we want to active some debugging options. The index.jsp page, shown in the browser in the lower left panel, displays the computed values of the different context-params from web.xml.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now after changing the active profile (due to a bug in m2e-core 0.12.0, the pom.xml needs to be saved twice for the change to be detected, but this has been <a class="jive-link-external-small" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=340159">fixed in m2e-core 0.13.0</a>) and after restarting tomcat (it doesn't restart the application upon web.xml changes), you'll notice the web.xml values are updated, values are taken from another properties file.</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16242/web-resource-filtering-profile2.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16242/450-238/web-resource-filtering-profile2.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3><span style="color: #666699;">Context root customization</span></h3><p>By default, the web project's context root is resolved from the <strong>&lt;finalName&gt;</strong> value resolved from the pom.xml. In the following example, the example-web project will be accessible at <a class="jive-link-external-small" href="http://localhost:8080/" target="_blank">http://localhost:8080/example/</a>, according to the finalName value&#160; :<span style="color: #666699;"><br/></span></p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16243/m2e-wtp-context-root-finalname.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16243/450-238/m2e-wtp-context-root-finalname.jpg </span></a></p><p>However, you can customize the context root used in WTP by setting a custom property in your pom.xml, for instance, if you need to use "/" as your context root, just add <strong>&lt;m2eclipse.wtp.contextRoot&gt;</strong> in your properties and update your maven project configuration :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">&lt;properties&gt;
&#160;&#160;&#160; ...
&#160;&#160;&#160; &lt;m2eclipse.wtp.contextRoot&gt;/&lt;m2eclipse.wtp.contextRoot&gt;
&#160;&#160;&#160; ... 
&lt;/properties&gt;
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>When restarting tomcat, the context root change will be detected and tomcat will ask to update its configuration. Now the same application is accessible at </span><a class="jive-link-external-small" href="http://localhost:8080/" target="_blank">http://localhost:8080/</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16244/m2e-wtp-context-root-property.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16244/450-238/m2e-wtp-context-root-property.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3><span style="color: #666699;">Java nature no longer added to EAR projects<br/></span></h3><p><span id="internal-source-marker_0.6966659519821405">The java nature was wrongly added to EAR projects. This is no longer the case. Moreover, existing Java nature will be automatically removed from existing EAR projects upon update project configuration.<br/></span></p><p><span><br/></span></p><h3><span style="color: #666699;">Generation of application.xml outside the source folders</span></h3><p>Since m2eclipse added support for EAR projects in 0.9.8, many users complained the deployment descriptor was generated under the source folder, under version control. Since application.xml (and jboss-app.xml) can be generated by maven automatically, there is no need to pollute the source folder right? Starting from m2eclipse-wtp 0.12.0, the deployment descriptors are now generated <span id="internal-source-marker_0.6966659519821405">under <strong>&lt;build directory&gt;/m2e-wtp/ear-resources</strong>. Similarly to the web projects, a new <strong>Application Ressources</strong> node is now displayed in the Project </span>Explorer <span id="internal-source-marker_0.6966659519821405">view, showing you which EAR resources will be deployed/exported.</span></p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16237/ear-application-resources.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16237/450-238/ear-application-resources.jpg </span></a></p><p>If, for some reason, one would still want to generate the deployment descriptors under the source folder (src/main/application by default), then you could right click on the project, open the project Properties and go to the <strong>Maven &gt; WTP integration</strong> page. There, after enabling specific project configuration, you can choose to NOT use the build folder to generate application.xml.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16240/m2e-wtp-project-properties.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16240/450-237/m2e-wtp-project-properties.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span id="internal-source-marker_0.6966659519821405">The same setting can be enabled globally for all EAR projects in the </span><span id="internal-source-marker_0.6966659519821405">workspace</span><span id="internal-source-marker_0.6966659519821405"> by opening the <strong>Preferences &gt; Maven &gt; WTP Integration </strong></span></p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16239/m2e-wtp-preferences.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16239/450-415/m2e-wtp-preferences.jpg </span></a></p><p>After validating your choice, all EAR projects in the workspace will update their configuration, if you choose so.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3><span style="color: #666699;">Support for the no-version file name mapping in maven-ear-plugin</span></h3><p><span id="internal-source-marker_0.6966659519821405">maven-ear-plugin 2.5 introduced a <a class="jive-link-external-small" href="http://maven.apache.org/plugins/maven-ear-plugin/examples/customize-file-name-mapping.html">new file name mapping strategy</a>, namely <strong>no-version</strong>, that remove the version suffix from all EAR deployed dependencies. All you need to do is add the following configuration to your&#160; maven-ear-plugin configuration : </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml">&#160; <span class="jive-xml-tag">&lt;plugin&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;groupId&gt;</span>org.apache.maven.plugins<span class="jive-xml-tag">&lt;/groupId&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>maven-ear-plugin<span class="jive-xml-tag">&lt;/artifactId&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>2.5<span class="jive-xml-tag">&lt;/version&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;configuration&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160; ...
&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;fileNameMapping&gt;</span>no-version<span class="jive-xml-tag">&lt;/fileNameMapping&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160; ...
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/configuration&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/plugin&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then you can check in the Project Explorer view, under the Deployment Descriptor node, all dependencies' names under the Bundle Libraries and Modules are updated :</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3769-16238/ear-noversion-filenamemapping.jpg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3769-16238/450-238/ear-noversion-filenamemapping.jpg </span></a></p><h3><span style="color: #666699;">Increased stability</span></h3><p>Many users, over the years, experienced random crashes during project import or configuration update, or saw test resources being deployed with their applications. All these issues could be <a class="jive-link-external-small" href="https://issues.sonatype.org/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=cf[10180]+%3D+ModuleCoreNature">linked</a> to one root cause : some WTP projects were missing a crucial element : the <strong>org.eclipse.wst.common.modulecore.ModuleCoreNature</strong> nature in their .project. The root cause of this "corruption" is still unclear, this is probably caused by some race condition, but unfortunately, this has proved impossible to reproduce with test projects. </p><p>m2eclipse-wtp 0.12.0 actually workarounds this issue : if the ModuleCoreNature is missing from WTP projects, it's automagically added to fix the projects, under the hood. Hopefully, this should fix most of the crashes users occasionally experience.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3><span style="color: #666699;">Now, what next?</span></h3><p>m2eclipse-wtp 0.12.0 is the last version supporting Eclipse 3.5 (Galileo) based platforms. Next 0.13.0 version will be aligned with the new, revamped m2e-core 0.13.0 (= future 1.0) and will be released at about the same time frame as Eclipse 3.7 Indigo (late june). The next big thing is the added support for war overlays, the single <a class="jive-link-external-small" href="https://issues.sonatype.org/browse/MECLIPSEWTP-2">most requested feature</a> in m2eclipse-wtp. If you like to live on the bleeding edge, you can already try the latest development builds, available under <a class="jive-link-external-small" href="https://repository.sonatype.org//content/sites/forge-sites/m2eclipse-wtp/0.13.0/N/">https://repository.sonatype.org//content/sites/forge-sites/m2eclipse-wtp/0.13.0/N/</a> (use the latest directory as your update site).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>One last thing : all this sweetness would not have been possible if I wasn't working full time on m2eclipse-wtp. Fortunately, Max R. Andersen got me a job in his JBoss Tools and Developer Studio team, and allows me to spend a considerable amount of time playing with my favorite toy of the moment :-) Thanks a bunch Max!!! Also big thanks to Eugene Kuleshov, Igor Fedorenko and Jason Van Zyl who gave me the chance to get involved in m2e(clipse).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Enjoy,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Fred.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/community/tools/blog/2011/05/03/m2eclipse-wtp-0120-new-noteworthy">going to Community</a></p>

</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>