- ALM: Bitbucket Cloud
- CI system: Bitbucket Pipelines
- Scanner command: - pipe: sonarsource/sonarcloud-scan:2.0.0
- Languages: scala, java
We have a large number of dependencies that are kept in the coursier cache. What’s the best way to populate the sonar.java.libs
setting with these dependencies? Do I have to create an explicit comma-separated list of all of them? Or do I just include the entire cache directory? If I include the whole directory, we’ll probably also be tracking test and dev dependencies, which would be better to omit.
The cache is configured as follows on bitbucket-pipeline.yml:
caches:
coursier: ~/.cache/coursier/v1
This is what I am getting when I configure it using the following:
-Dsonar.java.libraries=~/.cache/coursier/v1/**/*.jar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 18.591s
INFO: Final Memory: 21M/88M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: No files nor directories matching '~/.cache/coursier/v1/**/*.jar'
I get the same result if i just give it the directory: ~/.cache/coursier/v1
I am sure that the directory and the jar files are there on the pipeline build instance, but the sonar scanner doesn’t see it. Why?