How to Build JBoss Tools with Maven 3 - Working With Branches

The usual process for JBoss Tools development is to at some point in the cycle declare a code freeze, branch the code in trunk to a new branch, and begin building BOTH the stable branch and unstable trunk in parallel.

 

This allows stabilization of the code base for the upcoming milestone, candidate release, or GA, while in parallel allowing developers to continue working on new features in the trunk stream.

 

HOWEVER, this workflow introduces some workflow requirements when building JBoss Tools locally, which must be remembered.

 

Here are the rules to remember when switching between branches, to ensure you build against the correct upstream bits.

 

 

1. Always rebuild the parent pom for the branch in which you're working before then building a component, site, feature, or plugin in that branch. This will ensure that your component is built against the correct upstream binaries from the composite staging site defined in the parent pom, ie., http://download.jboss.org/jbosstools/builds/staging/_composite_/3.3.indigo/ or http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/

 

cd ~/jbosstools-some-branch/build/parent; mvn clean install

 

 

2. If not building everything locally, switch ~/.m2 repos when switching branches. Because Tycho will resolve dependencies against your local ~/.m2 repository as well as the upstream composite staging site defined in the JBoss Tools parent pom, and doesn't care if the latest version of org.jboss.common is from M5 or Beta1 (it only cares that the timestamp is more recent) it may pick the wrong stream's binary. So, to avoid this, you need to either rebuild the upstream component locally using the bootstrap profiles, or maintain two ~/.m2 folders and switch between them when switching branches.

 

# build something in trunk

cd ~/jbosstools-trunk/build/parent; mvn clean install

cd ~/jbosstools-trunk/path/to/component-site-feature-or-plugin-to-build; mvn clean install

 

# move trunk m2 repo and start a new one

mv ~/.m2 ~/.m2-trunk

 

# this will take a while to bootstrap as the ~/.m2 repo is initially empty

cd ~/jbosstools-some-branch/build/parent; mvn clean install

cd ~/jbosstools-some-branch/path/to/component-site-feature-or-plugin-to-build; mvn clean install

 

# switch from branch back to trunk repo

mv ~/.m2 ~/.m2-branch; mv ~/.m2-trunk ~/.m2

 

# build something in trunk

cd ~/jbosstools-trunk/build/parent; mvn clean install

cd ~/jbosstools-trunk/path/to/component-site-feature-or-plugin-to-build; mvn clean install

 

 

3. If building everying locally, use bootstrap profiles to rebuild everything upstream too. This will guarantee you've rebuilt upstream components locally from the correct branch. Bootstrap profiles are listed here: https://anonsvn.jboss.org/repos/jbosstools/trunk/build/pom.xml

 

Thus, instead of building just a component, site, feature, or plugin...

 

cd ~/jbosstools-some-branch/build/parent; mvn clean install

 

# then one or more of these

cd ~/jbosstools-some-branch/jmx; mvn clean install

cd ~/jbosstools-some-branch/jmx/site; mvn clean install

cd ~/jbosstools-some-branch/jmx/features/org.jboss.tools.jmx.feature; mvn clean install

cd ~/jbosstools-some-branch/jmx/plugins/org.jboss.tools.jmx.core; mvn clean install

 

you must build the whole stack, like this:

 

cd ~/jbosstools-some-branch/build/parent; mvn clean install

cd ~/jbosstools-some-branch/build; mvn clean install -P jmx-bootstrap

 

If you discover a bootstrap profile is missing, incorrect, or incomplete, feel free to fix it in SVN or open a JIRA and report the issue with as much detail as possible.

 

----

 

For more information on building JBoss Tools, including testing, building in Eclipse, and resolving target platforms locally to save time/bandwidth/frustration, see https://community.jboss.org/wiki/HowtoBuildJBossToolswithMaven3.