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

Sonar Plugin uses wrong maven repository

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sonar-plugin
    • None
    • * Jenkins 1.492, Sonar Plugin 2.0.1, Sonar 3.2
      * Master (not building)
      * Multiple nodes with multiple executors
      * individual host for Sonar
      * individual host for Sonar's db

      System Setup:

      • Jenkins is configured with Maven Project Configuration - Local Maven Repository set to Local to the executor to avoid concurrency problems with multiple maven builds on the same repository.
        With this setting, the repositories on the machines are located at /path-to-jenkins/jenkins/maven-repositories/${EXECUTOR_NUMBER}/. With clean install, the artifacts are deployed in the executors repository.
        This setup works fine for all the jobs we have.
      • On a local machine (and sonar configured), mvn sonar:sonar works fine.

      Error:

      • When using the sonar plugin for the project, the project fails due to missing dependencies, although they have been created minutes ago.

      Analysis:

      • In the build-log, I found that the sonar plugin executes the sonar call with this repository:
         -Dmaven.repo.local=/path-to-jenkins/jenkins/workspace/project-name/.repository 

      This looks to me like sonar is using a project-based repository. I could not find a setting that lets sonar use the repository of the executor.

      Expectation:
      I expect the sonar plugin to automatically use the same maven repository that is used by the maven build step.

            sonarteam Sonar Team
            twolfart twolfart
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: