Activating Maven profiles as part of a Jenkins-job Sonar phase

Problem description:

We have a Jenkins job that runs a maven build that activates certain maven-profiles (maven Goals and options in my case: clean install -U -P all,runtime). The same job activates Sonar plugin as a post-build action. Running the Sonar on the job without pointing to a certain maven profiles assumes that there aren't any instead of passing the same profiles to the Sonar plugin.

 

Solution

In the job Sonar configuration (Post-build actions/Sonar/Advanced...) add a --activate-profiles switch to the 'Additional properties' setting (in my case: --activate-profiles all,runtime)

Thank you for your interest!

We will contact you as soon as possible.

Want to Know More?

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com
Thank you for your interest!

We will contact you as soon as possible.

Let's talk

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com