SonarQube Jenkins
  1. SonarQube Jenkins
  2. SONARJNKNS-77

A freestyle jobs private local Maven is not used

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:
      Jenkins version 1.423,
      Maven 3.0.3
    • Number of attachments :
      0

      Description

      For a "freestyle" Jenkins job which is using a private local Maven repository (build option "Use private Maven repository") the corresponding Maven commandline argument "-Dmaven.repo.local=<path to job>/.repository" isn't added by the Sonar plugin automatically.

      Currently one has to provide this commandline argument as an additional property to the Sonar plugin.

      This seemed to be fixed in version 1.1 (see SONARPLUGINS-101), but the console output of my freestyle job indicates that's not true for this kind of jobs:

      Here the "normal" goal:

      /opt/maven/3.0.3/bin/mvn -f pom.xml -Dmaven.repo.local=/opt/hudson/main/working/jobs/sonar-frameworks/workspace/.repository install

      and here the command line for the sonar:sonar goal:

      mvn -f /opt/hudson/main/working/jobs/sonar-frameworks/workspace/pom.xml -e -B sonar:sonar -Dsonar.jdbc.driver=... -Dsonar.jdbc.url=... ******** ******** -Dsonar.host.url=...

        Activity

        Hide
        Julien HENRY added a comment -

        As for other parameters (alternate settingsx.xml, pom location, ...) in a freestyle job we can't rely on the values in the Maven step (because it is possible to have 0..n Maven steps) so I have added the parameter "use private Maven repo" on the Sonar post job itself.

        Show
        Julien HENRY added a comment - As for other parameters (alternate settingsx.xml, pom location, ...) in a freestyle job we can't rely on the values in the Maven step (because it is possible to have 0..n Maven steps) so I have added the parameter "use private Maven repo" on the Sonar post job itself.
        Hide
        Fabrice Bellingard added a comment -

        Hi Julien, looks like the parameter is not saved when updating the config, I cannot test it.

        Show
        Fabrice Bellingard added a comment - Hi Julien, looks like the parameter is not saved when updating the config, I cannot test it.
        Hide
        Julien HENRY added a comment -

        Should be fixed now. To mimic what is possible in a freestyle job Maven step is is now only possible to tell to use a private repository (no more locator).

        Show
        Julien HENRY added a comment - Should be fixed now. To mimic what is possible in a freestyle job Maven step is is now only possible to tell to use a private repository (no more locator).
        Hide
        Fabrice Bellingard added a comment -

        Tested!

        Show
        Fabrice Bellingard added a comment - Tested!

          People

          • Assignee:
            Julien HENRY
            Reporter:
            René Zanner
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: