Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: BUILD-STABILITY-1.2
-
Component/s: Build Stability
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
If project.getConfiguration().getString(CI_URL_PROPERTY) does not return a URL (CiManagement property is blank, as is the case of a new project in Sonar) and the project.getPom() is null, a NPE is thrown by the project.getPom().getCiManagement() call.
I am attaching a patch that I have used to fix the issue for my system.
Reproduction:
Install the Build Stability plugin in Sonar and Hudson
Configure the Hudson plugin
Configure the Sonar plugin
Create a new job in Hudson (Not Maven, no POM) and use the 'Invoke Standalone Sonar Analysis' to publish the results to Sonar
Execute the job on Hudson and you should get an NPE from the Build Stability Sonar plugin
Issue Links
- is duplicated by
-
SONARPLUGINS-1739
When using the standalone Sonar runner, we get a NullPointerException during the Sonar analysis
-
If my Jenkins job specifies this property:
sonar.build-stability.url=Hudson:http://example.com/job/MyJob/
then everything works.
However, many jobs have not been configured to use the build stability plugin, so they just fail because of this issue. Here's another suggested workaround: Change the plugin so that it does not work unless explicitly enabled. That way projects that do not know or care about this plugin can still function.