code detection jenkins sonarqube

install pgsql and sonarqube

docker run --name postgresqldb -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -d postgres 
docker run --name sq --link postgresqldb -e SONARQUBE_JDBC_URL=jdbc:postgresql://postgresqldb:5432/sonar -p 9000:9000 -d sonarqube
 

maven集成

在MAVEN_HOME/conf/settings.xml中,添加配置:

<pluginGroups>
    <pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
</pluginGroups>


<profile>
    <id>sonar</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <sonar.host.url>
            HTTP: // localhost: 9000 
        </sonar.host.url> 
    </ the Properties> 
</ Profile> 
 

the Java code detection 
mvn sonar: sonar command code analysis
  

 

Guess you like

Origin www.cnblogs.com/ipyanthony/p/11354022.html
Recommended