How do you split mvn reactor into Bamboo jobs so groups of module build by different jobs?

To make the most out of bamboo's stagesand jobs I want to
a) split maven lifecycle phases across bamboo stages (Build -> Test -> Deploy)
b) split each stage into parallel jobs

I know how to split phases and stages:
BUILD:  mvn clean install -DskipTests
TESTS:   mvn surefire:test failsafe:test
DEPLOY:  mvn clean deploy -DskipTests    (rebuild - yick)

I don't know how to split across jobs.  I'd like something that allowed me to run maven with multiple threads to determine which projects should be in each thread or job so I could construct the command line for each thread.

mvn do-thing -T4
Generates cmdline1.XML thru 4.XML
Jobs 1thru 4 invoke mvn using the XML to extract proper cmdline

Do you know of a plugin or cmdline option for this?

 

Thanks

 

Peter

2 answers

0 votes

I think you're requesting impossible. Some limitations I can see:

  • surefire:test failsafe:test will also run compile:compile so I don't see a point in a separate job that will only do the building (unless you want to test if it compiles)
  • you can achieve some level of separation by using maven profiles and use TESTA job to run mvn test -Pprofile_test_a, TESTB job to run mvn test -Pprofile_test_b, etc

If you want to emulate some kind of dynamic job configuration you can emulate it using 2 script tasks. First of them would generate a script for another script task to run

I think you can also use surefire's/failsafe's allow you to run tests in multiple threads

 

Bamboo cannot automatically do this, but I swear I saw a talk of the JIRA build team where they created an elastic build.  I'll need to dig deeper on that.  I created a feature request for now and will need to play around with running mvn validate -T4 to see if I can transform this into lists of "-pl group:artifact" statements which I could feed to identical jobs for execution.

 

https://jira.atlassian.com/browse/BAM-15312

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,066 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot