Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7105

Sonar plugin does not resolve "alternate settings file" correctly for Maven project

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • sonar-plugin
    • None

      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.

          [JENKINS-7105] Sonar plugin does not resolve "alternate settings file" correctly for Maven project

          Stevo Slavić added a comment -

          I believe this is related to or even caused by JENKINS-4693.

          Stevo Slavić added a comment - I believe this is related to or even caused by JENKINS-4693 .

          Stevo Slavić added a comment -

          This issue depends on JENKINS-4693

          Stevo Slavić added a comment - This issue depends on JENKINS-4693

          godin added a comment -

          See http://jira.codehaus.org/browse/SONARPLUGINS-910

          Please don't use this Jira in future to report bugs in Sonar Plugin - use https://jira.codehaus.org/browse/SONARPLUGINS/component/13726 instead.

          godin added a comment - See http://jira.codehaus.org/browse/SONARPLUGINS-910 Please don't use this Jira in future to report bugs in Sonar Plugin - use https://jira.codehaus.org/browse/SONARPLUGINS/component/13726 instead.

            godin godin
            allenservedio allenservedio
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: