Support of absolute Paths within SonarQube Scanner Config

scanner

(Christoph Forster) #1

My project has different SubModules, located in different directories.

e.g. Module 1 is in

/home/user/project/src/main/java/module1

Module 2 in

/home/user/project/src/main/java/submodules/module2

Now I have the problem, that I can either configure e.g. “sonar.java.libraries” for each Submodule

submodule1.sonar.java.libraries=…/…/…/…/lib/**/*.jar
submodule2.sonar.java.libraries=…/…/…/…/…/lib/**/*.jar

which bloats my config or I can add a “global” Config

sonar.java.libraries=…/…/…/…/lib/**/*.jar, …/…/…/…/…/lib/**/*.jar

Both variants are not so nice (I even had troubles finding the correct amount of “…/” to higher folders when writing this post :slight_smile: )

It would be a good improvement if you could additionally configure absolute paths

sonar.java.libraries=/home/user/project/lib/**/*.jar

Thanks,
Christoph

P.S.: The relative paths are containing two Dots, but the Editor always makes “…” out of it :wink:


(G Ann Campbell) #2

Hi,

What’s your build technology? If it’s Maven or Gradle, you should use the dedicated scanners, which will pick up that configuration implicitly.

 
Ann


(Christoph Forster) #3

Theoretically we use Gradle.
But the dependencies are not grabbed via Gradle but with some “external-dependencies.xml” which retrieve the dependencies anyhow with maven (no pom, no mvn calls).

So I already tried to switch to the gradle scanner but had the same problem than with SonarQube Scanner. Except running in Gradle.