Status: Closed (View Workflow)
The Sonar plugin does not resolve the alternate settings file configured for a Maven project properly.
I configured my Maven project with an "Alternate settings file" in the "Build" section. When the Sonar part of the build runs, it says that the settings file is invalid. I believe this is because it does not resolve the path to the settings file as the Maven build does (relative to the workspace) and so it cannot find the file.
Here is how the Maven build resolves the settings file called CRSReservationService-settings.xml:
Executing Maven: -B -f /common/build/sdkhudsonhome/.hudson/jobs/CRSReservationService-trunk-sonar/workspace/trunk/pom.xml -s /common/build/sdkhudsonhome/.hudson/jobs/CRSReservationService-trunk-sonar/workspace/trunk/etc/hudson/CRSReservationService-settings.xml clean install
Here is how the Sonar part of the build tries to resolve it (as you can see, it uses a relative path and so is not correct):
[trunk] $ /common/build/tools/maven/apache-maven-2.0.10/bin/mvn -f pom.xml -s trunk/etc/hudson/CRSReservationService-settings.xml -e -B sonar:sonar -Dsonar.jdbc.driver=oracle.jdbc.driver.OracleDriver -Dsonar.jdbc.url=jdbc:oracle:thin:@server:0000:DB ******** ******** -Dsonar.host.url=http://localhost:8080/sonar/ -Dsonar.branch=trunk
+ Error stacktraces are turned on.
WARNING: Alternate user settings file: trunk/etc/hudson/CRSReservationService-settings.xml is invalid. Using default path.
- depends on
JENKINS-4693 Alternate settings file not found
Please don't use this Jira in future to report bugs in Sonar Plugin - use https://jira.codehaus.org/browse/SONARPLUGINS/component/13726 instead.
I believe this is related to or even caused by JENKINS-4693.