How to configure Maven to run a SonarQube project analysis with two different quality profiles?

后端 未结 4 1321
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 03:19

We run SonarQube analyses for our Java projects via Maven. Maven somehow does this automagically; all we did was add the sonar-maven-plugin to our pom.xml

4条回答
  •  既然无缘
    2020-12-08 03:48

    Try to configure two executions of your plugin. Something like this:

    
        org.codehaus.mojo
        sonar-maven-plugin
        
            
                s1
                verify
                
                    sonar
                
                
                    MyQualityProfile1
                
            
            
                s2
                install
                
                    sonar
                
                
                    MyQualityProfile2
                
            
        
    
    

    This will start two executions of sonar in phases verify and install, each with another sonar.branch value. In Sonar you can then configure the required quality profiles after the first analysis.

提交回复
热议问题