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

SonarQube's sonar.ProjectBaseDir Set to the first module on the list

    XMLWordPrintable

Details

    Description

      VERSION:
      Jenkins 1.573
      Subversion Plugin 2.4.1
      Sonar Plugin 2.1

      When using multiple SVN Url's in one project, with each set to the following:

      Repository URL: http://svnserver/repo/Project/module1/trunk/src
      Local Module Directory: module1

      Repository URL: http://svnserver/repo/Project/module2/trunk/src
      Local Module Directory: module2

      ...

      My sonar.ProjectBaseDir is being set improperly, causing builds to fail. Where the property in this case should be set to C:\Jenkins\Jobs\Project\Workspace , it is instead being set to C:\Jenkins\Jobs\Project\Workspace\module1

      When trying to set the property manually with
      sonar.ProjectBaseDir=$WORKSPACE
      it comes out as -Dsonar.projectBaseDir=D:JenkinsjobsProjectNameworkspace (No slashes)

      Any attempts to backreference sonar properties to the workspace parent folder have proven unsuccessful

      Attachments

        Activity

          danielbeck Daniel Beck added a comment -

          Reducing priority as this does not result in crash or data loss, and seems to have an easy workaround in using the parent directory of the provided WORKSPACE.

          Please provide a sample job config.xml file.

          Please specify the version of Jenkins and Subversion plugin (we're not using the Jira version fields).

          danielbeck Daniel Beck added a comment - Reducing priority as this does not result in crash or data loss, and seems to have an easy workaround in using the parent directory of the provided WORKSPACE. Please provide a sample job config.xml file. Please specify the version of Jenkins and Subversion plugin (we're not using the Jira version fields).
          danielbeck Daniel Beck added a comment -

          Cannot reproduce the issue (haven't used your config exactly of course, but still, two locations checked out, both in subdirs, 'echo $WORKSPACE' in the shell...

          Do you have env-inject installed? If so, what version? What happens when you disable it, or could you set up a pristine Jenkins instance and try to reproduce the issue there?

          danielbeck Daniel Beck added a comment - Cannot reproduce the issue (haven't used your config exactly of course, but still, two locations checked out, both in subdirs, 'echo $WORKSPACE' in the shell... Do you have env-inject installed? If so, what version? What happens when you disable it, or could you set up a pristine Jenkins instance and try to reproduce the issue there?
          cole9350 Shawn Cole added a comment -

          Sorry Daniel, thanks for your troubleshooting, it seems the problem isn't related the to Workspace Environment Variable, but rather the sonar plugin. The Env-Inject Plugin is not installed on this instance.

          cole9350 Shawn Cole added a comment - Sorry Daniel, thanks for your troubleshooting, it seems the problem isn't related the to Workspace Environment Variable, but rather the sonar plugin. The Env-Inject Plugin is not installed on this instance.
          danielbeck Daniel Beck added a comment -

          And you even had echo %WORKSPACE% in there...

          FWIW it's almost sure SCM.getModuleRoot returning the first checked out module directory being used to set Sonar base directory. I observed the same braindead behavior with the Gradle plugin.

          danielbeck Daniel Beck added a comment - And you even had echo %WORKSPACE% in there... FWIW it's almost sure SCM.getModuleRoot returning the first checked out module directory being used to set Sonar base directory. I observed the same braindead behavior with the Gradle plugin.

          Is there any solution or workaround for this issue? I have the same problem with Jenkins 1.634 and SonarQube plugin 2.3... The SonarQube plugin always takes the first of many modules (checked out from subversion) as sonar.projectBaseDir...

          jgmeiner Johannes Gmeiner added a comment - Is there any solution or workaround for this issue? I have the same problem with Jenkins 1.634 and SonarQube plugin 2.3... The SonarQube plugin always takes the first of many modules (checked out from subversion) as sonar.projectBaseDir...

          We have the same problem with Jenkins 1.651 and SonarQube plugin 2.4.4

          it12lsp Christian Häussler added a comment - We have the same problem with Jenkins 1.651 and SonarQube plugin 2.4.4

          People

            Unassigned Unassigned
            cole9350 Shawn Cole
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: