sonar.host.url not working with sonar-maven-plugin:2.7

后端 未结 6 2027
眼角桃花
眼角桃花 2020-12-15 23:17

After upgrading my POMs to sonar-maven-plugin:2.7 the configuration does not work any more. My configuration in settings.xml is like this:


           


        
相关标签:
6条回答
  • 2020-12-15 23:42

    Better than disabling the plugin, you may fix the plugin version to 2.6, which works fine, taking into account sonar.host.url.

    For instance, with Maven in my case:

    <pluginManagement>
      </plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>2.6</version>
          <!-- sonar.host.url not working with version 2.7 -->
        </plugin>
      </plugins>
    </pluginManagement>
    
    0 讨论(0)
  • 2020-12-15 23:43

    Both

    mvn -Dsonar.host.url=http://localhost:9000 org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
    

    and

    mvn -Dsonar.host.url=http://localhost:9000 org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
    

    worked for me :

    0 讨论(0)
  • 2020-12-15 23:45

    Workaround: Adding -Dsonar.host.url=http://my.server:9000 to mvn command works for me

    0 讨论(0)
  • 2020-12-15 23:50

    I use the full qualified goal in the CI server to run the sonar goals:

    mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
    

    Since we use the templates in TeamCity this is not so much of a disaster. Still we were a bit surprised by the event.

    0 讨论(0)
  • 2020-12-15 23:50

    Instead of reconfiguring all jobs I disabled sonar for all jobs until this gets fixed. I added

    <sonar.skip>true</sonar.skip>

    to the sonar profile in settings.xml.

    0 讨论(0)
  • 2020-12-16 00:02

    We are investigating the issue. Ticket was created: https://jira.sonarsource.com/browse/MSONAR-129

    In the meantime you could either lock the SQ plugin to version 2.6 or pass all properties using command line.

    0 讨论(0)
提交回复
热议问题