JBoss Community

How to Build JBoss Tools with Maven3

modified by Nick Boldt in JBoss Tools Development - View the full document

Current trunk version of JBoss Tools can be built with maven 3 and make it faster and easier for everyone.

 

If you're trying to compile JBoss Tools within Eclipse for plugin development, read this to get all the dependencies installed.

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)

Environment Setup

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-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"

Sources

Checkout  sources from anonymous SVN like

 

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

 

This  will take some time dependent on your bandwidth

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.

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

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/pom.xml -P${component.name}-bootstrap

 

where  ${component.name} is component you want to build/test. Check in build/pom.xml for the available components you can build this way.

 

If you prefer to do things iteratively (one component at a time) you can check the order to build in http://anonsvn.jboss.org/repos/jbosstools/trunk/pom.xml or http://anonsvn.jboss.org/repos/jbosstools/trunk/build/pom.xml

 

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 build/pom.xml -P${component.name}-bootstrap/pom.xml

 

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

 

 mvn clean install -f build/pom.xml -Pjmx-bootstrap/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; \
 done

 


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

 

vi ~/trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml

 

6. Finally, ensure that the feature appears in all three update sites:

 

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

Comment by going to Community

Create a new document in JBoss Tools Development at Community