Globes in .properties sonar projects

I am working on a large old project that I am trying to accomplish starting with SonarQube. I am setting up a multi-module project in sonar-project.properties

. This works great. However, I have a problem with the exact definition of the source folders.

Unfortunately, our modules are not neatly separated in the file system. A project is split into multiple Eclipse projects, and multiple Eclipse projects together form a single module. I can, of course, list all the projects, but this is very cumbersome, since there are many of them. Here's a (simplified) version of our directory structure:

projects/
    moduleAsubmodule1/
        src/
            com/mycompany/moduleA/submodule1/
    moduleAsubmodule2/
        src/
            com/mycompany/moduleA/submodule2/
    moduleBsubmodule1/
        src/
            com/mycompany/moduleB/submodule1/
    moduleBsubmodule2/
        src/
            com/mycompany/moduleB/submodule2/
    moduleBsubmodule3/
        src/
            com/mycompany/moduleB/submodule3/

      

Imagine many more modules and submodules where the project name is concatenated, but the package names are nicely separated, making it much easier to differentiate them.

moduleA.sonar.projectBaseDir=.
moduleA.sonar.sources=projects/**/src/com/mycompany/moduleA/**/*
moduleA.sonar.test=projects/**/*.test/src/com/mycompany/moduleA/**/*

      

According to the documentation , this should be possible for exceptions. However, I am getting the following error:

16:10:44 ERROR: Unable to execute Sonar
16:10:44 ERROR: Caused by: The folder 'projects/**/src/com/mycompany/mymodule/**/*' does not exist for 'XXX:XXX:mymodule' (base directory = D:\XxxSonar\.)

      

So, I think globes don't work for sources? If so, what can I do?

We are using SonarQube 4.1.2.

+3


source to share


2 answers


Wildcards are not allowed when specifying "sonar.sources". Instead, you have to play with properties that allow you to narrow your source and test files. See the documentation page for how to include or exclude files to narrow the focus .



0


source


I had the same problem, but I solved it by doing like this:

sonar.sources=.
sonar.inclusions=projects/*/src/**/*

      



Include / exclude properties support wildcards. The same for your tests:

sonar.test.inclusions=projects/*/*.test/src/**/*

      

0


source







All Articles