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 votes

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 Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

166 views 4 1
Join discussion

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