<!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;">
    How to Build JBoss Tools with Maven3
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/dgolovin">Denis Golovin</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/community/jbosstools/blog/2010/06/27/how-to-build-jboss-tools-with-maven3">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>[Note: This blog were meant to be a wiki page, keeping this for prosperity but the right place to read/comment/edit is in the <a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-15513">wiki</a>]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.</p><h2>Prerequisites</h2><ol><li>Java 1.6 SDK</li><li>Maven 3.beta1</li><li>About 6 GB of free disk space if you want to run all integration tests for (JBoss AS, Seam and Web Services Tools)</li><li>subversion client 1.6.X (should work with lower version as well)</li></ol><h2>Environment Setup</h2><h3>Maven and Java</h3><p>Make sure your maven 3 is available by default and Java 1.6 is used.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">mvn -version
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>should print out something like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">Apache Maven 3.0-alpha-7 (r921173; 2010-03-09 14:31:07-0800)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-22-generic-pae" arch: "i386" Family: "unix"
</code></pre><h3>Sources</h3><p>Checkout sources from anonymous SVN like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">svn co https://svn.jboss.org/repos/jbosstools/trunk jbosstools-src
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This will take some time dependent on your bandwidth</p><h2>Build Strategies</h2><p>All commands below is assuming that commands are executed in jbosstools-src folder after sources checked out as it suggested above.</p><p>There are several strategies to chose from building everything to build particular component or part of it like all plug-ins, all tests, all features, particular plugin/feature.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Target platform should be built first like</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$mvn -f build/target-platform/pom.xml
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If you want to just compile the modules, tests can be skipped by adding system property -Dmaven.test.skip=true and you should be able to faster verify compile issues.</p><h3>Build/Test Everything</h3><p>Current version cannot be build without local changes because of problem with with drools component, so to go with this scenario you need to remove drools references from pom.xml and site/site.xml. After that to build/test everything use:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$mvn clean install
</code></pre><h3>Build/Test Particular Component with Dependencies</h3><p>For convenience there are aggregator projects defined for each component. It provides a simple way to build/test components with dependencies.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$mvn clean install -f build/component/${component.name}.xml
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>where ${component.name} is component you want to build/test. Currently build/component folder contains aggregator projects for:</p><ol><li> tests, </li><li>jmx, </li><li>archives, </li><li>as, </li><li>common, </li><li>seam</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>more is coming soon.</p><h3>Build/Test Single Component</h3><p>Be aware that to get this work all dependencies for this component must be installed in maven repo. It can be done by build everything first or by build component and its dependencies using aggregated project as it explained above. You can skip tests for this build and then enable them back when you run single component build.</p><p>To build single component use pom.xml in component's folder like it is shown below.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">$mvn clean install -f $<font color="navy">{</font>component.name<font color="navy">}</font>/pom.xml
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>where ${component.name} is component's root folder name. For instance to build jmx component use command below</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">$mvn clean install -f jmx/pom.xml
</code></pre></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/community/jbosstools/blog/2010/06/27/how-to-build-jboss-tools-with-maven3">going to Community</a></p>

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


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

</div>

</body>
</html>