[jboss-dev-forums] [JBoss Tools Development] - How to Build JBoss Tools with Maven 3 - Working With Branches

Nick Boldt do-not-reply at jboss.com
Tue Jan 17 12:41:30 EST 2012


Nick Boldt [https://community.jboss.org/people/nickboldt] created the document:

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

To view the document, visit: https://community.jboss.org/docs/DOC-17497

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

So, here are the rules to remember when switching between branches.

*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/ http://download.jboss.org/jbosstools/builds/staging/_composite_/3.3.indigo/ or  http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/ 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 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  https://issues.jboss.org/secure/CreateIssue.jspa?pid=10020&issuetype=1 open a JIRA and report the issue with as much detail as possible.
--------------------------------------------------------------

Comment by going to Community
[https://community.jboss.org/docs/DOC-17497]

Create a new document in JBoss Tools Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2129]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120117/6abdfa74/attachment.html 


More information about the jboss-dev-forums mailing list