-
Type:
Improvement
-
Resolution: Postponed
-
Priority:
Major
-
Component/s: sonar-plugin
-
None
There is no way to invoke the sonar plugin on a new maven released version (from freestyle/maven jobs, and even from the m2 release plugin): the sonar plugin uses the pom file found for the previous job steps and not the "released" one ( found in target/checkout by default). Even -f or --file parameters on sonar plugin config are ignored because they are set after the previous one, and perform's "checkoutDirectory" cannot be set on the workspace dir.
It is very annoying because, in my organisation, we want to set release job templates with automatic sonar invokation on the released version on a same job (which, in my mind, is an absolute need for customer delivered components). The generate report shows then the "next development" version in sonar. Additionally, we do not want to put sonar configs in pom or other because the sonar instances' configs are better centralized then in jenkins.
The only (VERY ugly) workaround I found was to use the M2 extra steps plugin and override the workspace's "root" pom by the released one before the sonar invokation...