Comments (10)
Adding .settings(aggregate in sonarScan := false)
does the job. Thanks. 👍
from sbt-sonar.
It looks all good on my end... I think your problem might be related to how you configured the project in your build.sbt. Also, you want sonnarScan
to be run only once for your root project, so you need to exclude the task from the aggregation by setting aggregate in sonarScan
to false
.
I just added an example multi-module project, which you can use as a reference 47126c4.
from sbt-sonar.
Hi @mwz , thanks for the answer.
I'm also almost 100% convinced that this looks like a misconfiguration.
The annoying think is that I don't know where it is. Looking at the documentation, everything seems to be fine (well... we know how that goes :D ). So, if you have any ideas of where I should look into, let me know.
Thanks
from sbt-sonar.
Just to report it here.
I created a new jar file from the master branch for the Scala plugin I'm using (Sagacify/sonar-scala) and updated it in Sonarqube. But, still, the property <sub-project>.sonar.scoverage.reportPath
were needed to be defined manually.
If this is a issue in the plugin, or a misconfiguration on my side, it's still unclear. But since I did this small investigation, it's nice to report it here, so others might find this useful.
@mwz Thanks for the help! This issue can be happily closed. :)
from sbt-sonar.
Btw, using Scala 2.12.3, SonarQube 6.7.1, and Sbt-sonar 1.3.0.
from sbt-sonar.
Hi @ricardoatsouza, thanks for the shout - I'll have a look. I've used sonar with multi-module projects without any issues in the past, so it might be just a misconfiguration.
I was planning to add a multi-module example to sbt tests, so this is a perfect opportunity to do this.
from sbt-sonar.
Now, I'm facing another issue. Somehow sonar-scanner
cannot find scoverage.xml
.
I keep seeing this in the logs:
ERROR: [scoverage] Report not found at /Users/username/Development/projectFolder/module-1/target/scala-2.12/scoverage-report
WARN: [scoverage] Report path not set for Module 1 module! [Module 1.sonar.scoverage.reportPath]
However, a ls module-1/target/scala-2.12/scoverage-report
shows me that the file is there:
index.html ingestion ingestion.html overview.html packages.html scoverage.xml
I'm aware that this problem is not related to sbt-sonar, but since we are in this chat, do you have a better idea of why this might be happening?
from sbt-sonar.
Actually, by setting manually the properties reportPath
for both sub-projects solved the issue. Basically, what I did was adding these two lines to my build.sbt
, in the sonarProperties
variable:
"module-1.sonar.scoverage.reportPath" -> "target/scala-2.12/scoverage-report/scoverage.xml",
"module-2.sonar.scoverage.reportPath" -> "target/scala-2.12/scoverage-report/scoverage.xml",
Funny thing is: setting manually those variables should not actually be necessary, since this path was already being logged before. But this solution will solve it for now.
As a final check, I will update the Scala plugin in Sonarqube.
from sbt-sonar.
Thanks @ricardoatsouza for digging a little bit deeper.
I'd recommend sticking to SonarQube 5.6.7 for now until the sonar-scala
plugin is compatible with 6.7.1 LTS. I've been doing some work in my fork of the project and I'm planning to make a release once it's ready, so you can keep an eye on sonar-scala/sonar-scala#5.
Your issues might be also related to how you set up your sbt project but it's difficult to say without seeing the config.
I think we can also improve sbt-sonar
to automatically set sonar.sources
, sonar.scoverage.reportPath
and sonar.scala.scapegoat.reportPath
for each module so you don't need to set this up manually (#9).
from sbt-sonar.
@mwz Nice to hear that there are good stuff coming :)
Thanks for your support. I will have this repo in my watch list.
Cheers!
from sbt-sonar.
Related Issues (20)
- Support Server authentication token HOT 3
- sonarScan failing with multi module not directly under root path HOT 6
- scripted tests are broken
- java.lang.IllegalAccessError: class org.sonarsource.scala.checks.DuplicateBranchScalaCheck$$Lambda$5577/0x00000008020cdb00 HOT 2
- Plugins ignore some properties HOT 1
- Accept system properties when using an external config (sonarUseExternalConfig)
- Improved usage/getting started documentation HOT 5
- The 'sonar.scala.version' is not properly set or is missing HOT 3
- Add 'sonar.tests' property
- Settings with Subprojects HOT 1
- Analyze with Sonar also Java sources
- I have lots of unresolved dependencies HOT 2
- sbt analogue for `mvn sonar:sonar -Dsonar.host.url=http://localhost:9000` HOT 7
- scoverage report upload doesn't work HOT 10
- Have you seen this? HOT 1
- Non-zero exit with RuntimeException after successfully uploading the report HOT 2
- sonar.scala.scoverage.reportPath not honored HOT 1
- Show specific failed test in sonar UI HOT 1
- Issue when pushing to upstream branch due to OverlappingFileLockException HOT 4
- sonarScan ignoring report path properties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-sonar.