[jboss-user] [JBoss Tools Development] - How to Build JBoss Tools with Maven3

Nick Boldt do-not-reply at jboss.com
Thu Aug 12 20:39:24 EDT 2010

Nick Boldt [http://community.jboss.org/people/nickboldt] modified the document:

"How to Build JBoss Tools with Maven3"

To view the document, visit: http://community.jboss.org/docs/DOC-15513

Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.
h2. Prerequisites
1. Java 1.6 SDK
2. Maven 3.beta1
3. About  6 GB of free disk space if you want to run all integration tests for  (JBoss AS, Seam and Web Services Tools)
4. subversion client 1.6.X  (should work with lower version as well)
h2. Environment Setup
h3. Maven  and Java
Make sure your maven 3 is available by default and Java 1.6 is used.

$mvn -version

should  print out something like

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-
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "" arch: "i386" Family: "unix"

h3. Sources
Checkout  sources from anonymous SVN like

$svn co http://anonsvn.jboss.org/repos/jbosstools/trunk jbosstools-src

This  will take some time dependent on your bandwidth
h2. Build Strategies
All  commands below is assuming that commands are executed in jbosstools-src  folder after sources checked out as it suggested above.
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.

Target platform and parent pom should be built first like

$mvn clean install -f build/parent/pom.xml

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.
h3. Build/Test Everything
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:

$mvn clean install
h3. Build/Test  Particular Component with Dependencies
For convenience there are  aggregator projects defined for each component. It provides a simple  way to build/test components with dependencies.

$mvn clean install -f build/component/${component.name}.xml

where  ${component.name} is component you want to build/test. Currently  build/component folder contains aggregator projects for:
1.  tests 
2. jmx 
3. archives 
4. as 
5. common 
6. seam
7. vpe
8. archives
9. as

More are coming soon. To know the order in which to build prerequisite components for your component, see  http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml
h3. Build/Test Single Component
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.
To build single component use pom.xml in component's folder like it is shown below.

$mvn clean install -f ${component.name}/pom.xml

where  ${component.name} is component's root folder name. For instance to build jmx component use command below

$mvn clean install -f jmx/pom.xml

or :if you prefer, you can build a series of components in order (with tests skipped using *-Dmaven.test.skip=true*):

$for d in tests jmx archives as; do \
    pushd $d; mvn clean install *-Dmaven.test.skip=true*; popd; \


h3. Adding a Plugin To An Existing Component
Now that you can build your component, you can easily add a new plugin to that component. Here's how.

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).

1. When you are satisfied, you can commit your new plugin project to SVN.

    cd ~/trunk/as/plugins
    svn add org.jboss.ide.eclipse.as.rse.core
    svn ci -m "JBIDE-123456 Initial commit of new org.jboss.ide.eclipse.as.rse.core plugin" org.jboss.ide.eclipse.as.rse.core

2. Next, add a pom.xml file to the root of your new project.

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.

3. Build your plugin:

    cd ~/trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core
    mvn3 clean install

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:

    vi ~/trunk/as/plugins/pom.xml

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, and that that feature appears in three places:

    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, which includes pi4soa, Teiid Designer, XulRunner, Drools, and more)


Comment by going to Community

Create a new document in JBoss Tools Development at Community
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100812/b783e065/attachment-0001.html 

More information about the jboss-user mailing list