Sonar properties files

前端 未结 3 428
不知归路
不知归路 2020-12-15 23:14

I have a project that has the following package structure

src/main/proj
    -com.company.package
        -appName
            -morepackages

        -appVers         


        
3条回答
  •  一整个雨季
    2020-12-15 23:37

    You have to specify the projectBaseDir if the module name doesn't match you module directory.

    Since both your module are located in ".", you can simply add the following to your sonar-project properties:

    module1.sonar.projectBaseDir=.
    module2.sonar.projectBaseDir=.
    

    Sonar will handle your modules as components of the project:

    Result of Sonar analysis

    EDIT

    If both of your modules are located in the same source directory, define the same source folder for both and exclude the unwanted packages with sonar.exclusions:

    module1.sonar.sources=src/main/java
    module1.sonar.exclusions=app2code/**/*
    
    module2.sonar.sources=src/main/java
    module2.sonar.exclusions=app1code/**/*
    

    More details about file exclusion

提交回复
热议问题