GithubHelp home page GithubHelp logo

Comments (10)

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024 3

Adding .settings(aggregate in sonarScan := false) does the job. Thanks. 👍

from sbt-sonar.

mwz avatar mwz commented on July 20, 2024 2

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024 1

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024 1

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024

Btw, using Scala 2.12.3, SonarQube 6.7.1, and Sbt-sonar 1.3.0.

from sbt-sonar.

mwz avatar mwz commented on July 20, 2024

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024

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.

mwz avatar mwz commented on July 20, 2024

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.

ricardoatsouza avatar ricardoatsouza commented on July 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.