<!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/nickboldt">Nick Boldt</a> in <i>JBoss Tools Development</i> - <a href="http://community.jboss.org/docs/DOC-15513">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><em><strong>If you're trying to compile JBoss Tools within Eclipse for plugin development, <a class="jive-link-external-small" href="https://community.jboss.org/wiki/JBossToolsTargetPlatformProvisioningorhowtoresolvemissingdependencieswhencompilingJBossTools">read this to get all the dependencies installed</a>.</strong></em></p><h2>Prerequisites</h2><ol><li>Java 1.6 SDK</li><li>Maven 3.beta1</li><li>About&#160; 6 GB of free disk space if you want to run all integration tests for&#160; (JBoss AS, Seam and Web Services Tools)</li><li>subversion client 1.6.X&#160; (should work with lower version as well)</li></ol><h2>Environment Setup</h2><h3>Maven&#160; 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&#160; 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-beta-2 (r983206; 2010-08-07 07:00:51-0400)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32.14-127.fc12.i686" arch: "i386" Family: "unix"
</code></pre><h3>Sources</h3><p>Checkout&#160; 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 http://anonsvn.jboss.org/repos/jbosstools/trunk jbosstools-trunk</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This&#160; will take some time dependent on your bandwidth</p><h2>Build Strategies</h2><p>All&#160; commands below is assuming that commands are executed in jbosstools-src&#160; folder after sources checked out as it suggested above.</p><p>There are&#160; several strategies to chose from building everything to build&#160; particular component or part of it like all plug-ins, all tests, all&#160; features, particular plugin/feature.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Target platform and parent pom 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 clean install -f build/parent/pom.xml</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If&#160; you want to just compile the modules, tests can be skipped by adding&#160; system property <span style="font-family: courier new,courier;"><strong>-Dmaven.test.skip=true</strong></span> and you should be able to faster verify compile issues.</p><h3>Build/Test Everything</h3><p>Current&#160; version cannot be build without local changes because of problem with&#160; with drools component, so to go with this scenario you need to remove&#160; drools references from pom.xml and site/site.xml. After that to&#160; 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&#160; Particular Component with Dependencies</h3><p>For convenience there are&#160; aggregator projects defined for each component. It provides a simple&#160; 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&#160; ${component.name} is component you want to build/test. Currently&#160; build/component folder contains aggregator projects for:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ol><li> tests </li><li>jmx </li><li>archives </li><li>as </li><li>common </li><li>seam</li><li>vpe</li><li>archives</li><li>as</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>More are coming soon. To know the order in which to build prerequisite components for your component, see <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml">http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml</a></p><h3>Build/Test Single Component</h3><p>Be aware that&#160; to get this work all dependencies for this component must be installed&#160; in maven repo. It can be done by build everything first or by build&#160; component and its dependencies using aggregated project as it explained&#160; 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"> mvn clean install -f ${component.name}/pom.xml</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>where&#160; ${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><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>or, if you prefer, you can build a series of components in order (with tests skipped using <strong>-Dmaven.test.skip=true</strong>):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"> for d in tests jmx archives as; do \
&#160;&#160;&#160; pushd $d; mvn clean install -Dmaven.test.skip=true; popd; \
 done</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><hr/><h3>Adding a Plugin To An Existing Component</h3><p>Now that you can build your component, you can easily add a new plugin to that component. Here's how.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>0. Make sure your new plugin compiles in your workspace. Ensure your MANIFEST.MF contains all references/includes/requirements you need. Be sure to set the correct Bundle-RequireExecutionEnvironment (eg., JDK5 or JDK6).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1. When you are satisfied, you can commit your new plugin project to SVN.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"> cd ~/trunk/as/plugins; \
 svn add org.jboss.ide.eclipse.as.rse.core; \
 svn ci -m "JBIDE-123456 Initial commit of new as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2. Next, add a pom.xml file to the root of your new project.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>You can use m2eclipse to help w/ this if you have it installed; otherwise copy from another existing plugin project and edit appropriately. The version of the pom should match the version in the manifest.mf. Note that 3.2.0.qualifier (in MANIFEST.MF) is equivalent to 3.2.0-SNAPSHOT in the pom.xml.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>3. Build your plugin:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"> cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core; \
 mvn3 clean install
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4. If your component's new plugin builds successfully, you can commit the pom.xml file, and add a reference to the new plugin (module) in the container pom:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"> vi ~/trunk/as/plugins/pom.xml</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>5. To ensure that your plugin is available on the update site, be sure that it is contained in at least one feature's feature.xml.</p><pre ___default_attr="plain" jivemacro="code"> <p>vi ~/trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml</p></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>6. Finally, ensure that the feature appears in all three update sites:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code"> vi ~/trunk/as/site/site.xml # (the AS update site)
 vi ~/trunk/site/site.xml # (the JBoss Tools update site) and
 vi ~/trunk/build/aggregate/site/site.xml # (the JBoss Tools aggregate update site, incl. pi4soa, Teiid, ...)
</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/docs/DOC-15513">going to Community</a></p>

        <p style="margin: 0;">Create a new document in JBoss Tools Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2129">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>