Customize build email based on compiler warnings


I would like to modify the standard bamboo build email to include information about compiler warnings.

For example, instead of this:

#10 was successful

100 tests in total.

I want to say this:

#10 was successful but with warnings

100 tests in total.

5 compiler warnings in total.

We use Maven task to complie our code and I've enabled complier warnings output in the project's POM.

I've also read Bamboo documenation on how to customize email notification message and confirmed that by modifying ChainCompletedHtmlEmail.ftl, I can get my email customized.

Now I need to figure out how to pass information about compiler warnings from Maven and use it in the build email.

Any suggestions will be appreciated.



1 answer

0 vote

Well, I think it's possible provided you have access to Bamboo source distro and you are not afraid of some coding...

The way I would do it is to create new Task Plugin using existing Bamboo Maven Task as a base. Code can be found in Bamboo source distribution.

The modifications would be:

- adding code to the output handler that would parse the Maven warning information

- add warning count (and whatever else you need) to results' custom data. Sth like that:

public TaskResult execute(@NotNull final TaskContext taskContext) throws TaskException {

///... maven stuff here
  taskContext.getBuildContext().getBuildResult().getCustomBuildData().put("warningCount", warningCount));

- custom data get's saved with JobResultsSummary and you should be able to access it in notification ftl

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,095 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