<!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="https://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;">
    Annotation Processing support in m2e
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="https://community.jboss.org/people/fbricon">Fred Bricon</a> in <i>JBoss Tools</i> - <a href="https://community.jboss.org/community/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out">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>Maven Integration for Eclipse JDT Annotation Processor Toolkit a.k.a <strong>m2e-apt</strong> is now available in its version 1.0. m2e-apt aims at providing automatic Annotation Processing configuration in Eclipse based on your project's pom.xml and its classpath dependencies&#160; (Requires Java &gt;= 1.6).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>m2e-apt supports both annotation processing set on the <a class="jive-link-external-small" href="http://maven.apache.org/plugins/maven-compiler-plugin/index.html">maven-compiler-plugin</a> or the <a class="jive-link-external-small" href="http://code.google.com/p/maven-annotation-plugin/">maven-processor-plugin</a> (the latter takes precedence over the former). </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>For example, to enable the JPA modelgen annotation processor, you can either set : </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;artifactId&gt;</span>maven-compiler-plugin<span class="jive-xml-tag">&lt;/artifactId&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>2.4<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; <span class="jive-xml-tag">&lt;source&gt;</span>1.6<span class="jive-xml-tag">&lt;/source&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;target&gt;</span>1.6<span class="jive-xml-tag">&lt;/target&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/configuration&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dependencies&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dependency&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;groupId&gt;</span>org.hibernate<span class="jive-xml-tag">&lt;/groupId&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>hibernate-jpamodelgen<span class="jive-xml-tag">&lt;/artifactId&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>1.2.0.Final<span class="jive-xml-tag">&lt;/version&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dependency&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dependencies&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>or </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"><span class="jive-xml-tag">&lt;plugin&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>maven-compiler-plugin<span class="jive-xml-tag">&lt;/artifactId&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>2.4<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; <span class="jive-xml-tag">&lt;source&gt;</span>1.6<span class="jive-xml-tag">&lt;/source&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;target&gt;</span>1.6<span class="jive-xml-tag">&lt;/target&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;compilerArgument&gt;</span>-proc:none<span class="jive-xml-tag">&lt;/compilerArgument&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/configuration&gt;</span> 
<span class="jive-xml-tag">&lt;/plugin&gt;</span> 
<span class="jive-xml-tag">&lt;plugin&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;groupId&gt;</span>org.bsc.maven<span class="jive-xml-tag">&lt;/groupId&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>maven-processor-plugin<span class="jive-xml-tag">&lt;/artifactId&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>2.0.5<span class="jive-xml-tag">&lt;/version&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;executions&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;execution&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;id&gt;</span>process<span class="jive-xml-tag">&lt;/id&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;goals&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;goal&gt;</span>process<span class="jive-xml-tag">&lt;/goal&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/goals&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;phase&gt;</span>generate-sources<span class="jive-xml-tag">&lt;/phase&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/execution&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/executions&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dependencies&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dependency&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;groupId&gt;</span>org.hibernate<span class="jive-xml-tag">&lt;/groupId&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;artifactId&gt;</span>hibernate-jpamodelgen<span class="jive-xml-tag">&lt;/artifactId&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;version&gt;</span>1.2.0.Final<span class="jive-xml-tag">&lt;/version&gt;</span> 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dependency&gt;</span> 
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dependencies&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>The generated source folders (target/generated-sources/annotation for maven-compiler-plugin; target/generated-sources/apt for maven-processor-plugin) are automatically added to the project classpath.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/38-4947-18598/m2e-apt.png"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4947-18598/450-269/m2e-apt.png </span></a></p><p>By default, Annotation Processing is managed by Eclipse JDT APT, so a change in your source classes triggers incremental processing automatically. The downside of using JDT APT is, there's no separation between main and test classes (the way maven-processor-plugin handles them). </p><p>To mitigate that limitation, you can change the workspace or project preferences to delegate annotation processing to maven, instead of JDT APT. This will result in slower incremental builds (all classes will be processed) but will provide identical results to maven command line builds. Note this only works when using maven-processor-plugin. When annotation processing is driven by maven-compiler-plugin, JDT APT is always used in eclipse.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Automatic annotation processing configuration from the maven pom.xml can also be disabled altogether. In this case, your manual settings for Eclipse JDT APT will remain untouched. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Go to Window &gt; Preferences &gt; Maven &gt; Annotation processing or right-click on your project &gt; Properties &gt; Maven &gt; Annotation processing to select the Annotation Processing strategy of your choice.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/38-4947-18599/m2e-apt-prefs.png"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/38-4947-18599/450-164/m2e-apt-prefs.png </span></a></p><p>m2e-apt is heavily based on the work from two community members : </p><ul><li>a <a class="jive-link-external-small" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335036">patch for m2e</a> by Karl M. Davis, from Knowledge Computing Corp, implementing Eclipse JDT APT configuration based on the maven-compiler-plugin's configuration.</li><li><a class="jive-link-external-small" href="https://github.com/excilys/m2e-extras/tree/master/com.excilys.ebi.m2e.apt">com.excilys.ebi.m2e.apt</a>&#160; by St&eacute;phane Landelle, from eBusiness Information, Excilys Group, implementing direct maven-processor-plugin invocation from m2e.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>m2e-apt is available :</p><ul><li>via a stable update site <a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt">http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt</a></li><li>for JBoss Tools 3.0.0.Beta3 users, via the Software/Update tab in JBoss Central</li><li>bundled with <a class="jive-link-external-small" href="https://devstudio.jboss.com/earlyaccess/">JBoss Developer Studio 5.0.0.Beta3</a></li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Source code is available at <a class="jive-link-external-small" href="https://github.com/jbosstools/m2e-apt">github</a>. If you find any bug, please raise a ticket on m2e-apt's <a class="jive-link-external-small" href="https://github.com/jbosstools/m2e-apt/issues?state=open">issue tracker</a>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Happy hacking,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Fred </p><p><a class="jive-link-external-small" href="https://twitter.com/#!/fbricon">https://twitter.com/#!/fbricon</a></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="https://community.jboss.org/community/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out">going to Community</a></p>

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


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

</div>

</body>
</html>