Skip to content

Instantly share code, notes, and snippets.

@vegaasen
Last active February 3, 2017 10:59
Show Gist options
  • Save vegaasen/85fc102d2fe03fbe9d849e1fb181b8a8 to your computer and use it in GitHub Desktop.
Save vegaasen/85fc102d2fe03fbe9d849e1fb181b8a8 to your computer and use it in GitHub Desktop.
Enable sonar-plugin with properties

Maven plugin

This is placed within: pom.xml > project > build > plugins:

<plugin>

       org.codehaus.mojo        sonar-maven-plugin        2.7.1    

The plugin itself requires a few properties to be set. This can be simplified by using a profile to wrap the functionality:

This is placed within: pom.xml > project > profiles:

           sonar                   false                          sonar:sonar                          <sonar.host.url>http://ukgw-build-vp01/sonar</sonar.host.url>            <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8</sonar.jdbc.url>            <sonar.jdbc.username>admin</sonar.jdbc.username>            <sonar.jdbc.password>whatever</sonar.jdbc.password>            <sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>            <sonar.host.url>http://localhost:9001</sonar.host.url>           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment