Sonar Maven项目 模板pom.xml


    4.0.0
    com.abc
    sonar-sample
    0.0.1-SNAPSHOT
    sonar-sample

    
        1.8
        target/classes   
    jacoco
        0.7.9
        ${project.basedir}/target
        jacoco-ut.exec
        ${jacoco.outputDir}/${jacoco.out.ut.file}
    

    
        
            sonar
            
                false
            
            
                http://192.168.126.128:9000
            
            
                
                    
                        org.apache.maven.plugins
                        maven-surefire-plugin
                        
                            ${jacoco.agent.ut.arg}
                        
                    

                    
                        org.jacoco
                        jacoco-maven-plugin
                        ${jacoco.version}
                        
                            
                                pre-unit-test
                                
                                    prepare-agent
                                
                                
                                    ${sonar.jacoco.reportPath}
                                    jacoco.agent.ut.arg
                                    true
                                
                            
                        
                    
                
            
            
                
                    junit
                    junit
                    4.12
                    test
                
            
        
    

    
        
            junit
            junit
            4.12
            test
        
    

    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                
            

            
                org.sonarsource.scanner.maven
                sonar-maven-plugin
                3.3.0.603
            
        
    

运行sonar scan

mvn clean package -Psonar sonar:sonar

你可能感兴趣的:(Sonar Maven项目 模板pom.xml)