It's all about the answers!

Ask a question

how to create build chain with jbe and maven

Fausto Lemos (16811418) | asked May 13 '13, 4:36 p.m.

it's possible to configure a chained build process using JBE and Maven?

i.e: after running build definition A, starts build definition B immediately.

if possible, what is the best option? configurin pom.xml? shell script (scm cli) ?


4 answers

permanent link
Jeff Care (1.0k3233) | answered May 13 '13, 4:53 p.m.
I think your best option would be to drive build A with a command line build def. Assuming that the call to Maven within the build A script was successful you could then use the build toolkit to request build B from the build A script.

permanent link
Fausto Lemos (16811418) | answered May 13 '13, 4:57 p.m.

could you provide more detailed information about this approach?

permanent link
Nick Edgar (6.5k711) | answered May 14 '13, 12:33 p.m.
You can use the requestTeamBuild Ant task to submit the downstream build request, optionally overriding build properties.  See the 2nd entry in the Build FAQ for pointers on the Ant tasks:

I've had difficulty in the past getting Maven to play well with Ant, especially when you need to bring in other libraries of tasks (like the RTC Build toolkit).  In the end I found it simpler to use the Maven-Ant plugin to launch an external ant, giving the necessary -f <path to build file> and -lib <build toolkit path> command line args, rather than trying to run the Ant script directly as a configuration in the Maven pom.

permanent link
Jeff Care (1.0k3233) | answered May 14 '13, 2:29 p.m.
You're trying to choreograph two related builds, right?

Use a command-line build definition to drive build A. We use Bash scripts in my project but you could use perl, python, whatever. From within that script, call out to Maven to build project A. Once Maven is done, inspect the return code. Did Maven complete without errors? If so use the Ant-based build toolkit (check the infocenter for details) to request a build of build B. Build A then ends.

Your answer

Register or to post your answer.