简体   繁体   English

如何触发多模块 Scala 项目的声纳分析?

[英]How to trigger sonarqube analysis for multi-module Scala project?

I need to analyse a multi-module Scala legacy project in Sonarqube v7.6 that has the Scala plugin already installed.我需要在已经安装了 Scala 插件的 Sonarqube v7.6 中分析一个多模块 Scala 遗留项目。

I am not very used to Scala and I overheard someone at the office saying it's not a standard project.我不太习惯 Scala,我无意中听到办公室有人说它不是一个标准项目。 Inside [ROOT_DIR] there is a folder app , that has only the launcher.在 [ROOT_DIR] 中有一个文件夹app ,它只有启动器。 Then I have domain and roles folders which contains modules, in [ROOT_DIR]/domain/[MODULE]/src and [ROOT_DIR]/roles/[MODULE]/src .然后我在[ROOT_DIR]/domain/[MODULE]/src[ROOT_DIR]/roles/[MODULE]/src有包含模块的domainroles文件夹。

I have tried a few things with no data being passed to Sonarqube.我尝试了一些事情,但没有将数据传递给 Sonarqube。 One of the most promising leads is from this question: Multi module project analysis with SonarQube .最有希望的线索之一来自这个问题: 使用 SonarQube 进行多模块项目分析

I don't mind having a sonar-project.properties file I can just run sbt sonarScan off the [ROOT_DIR] and check the analysis in sonarqube.我不介意有一个sonar-project.properties文件,我可以在 [ROOT_DIR] 上运行sbt sonarScan并检查 sonarqube 中的分析。

So far my sonar-project.properties looks like:到目前为止,我的sonar-project.properties看起来像:

sonar.projectKey=myProject
sonar.sources=src/main/scala


sonar.login=e0fc3c8acf7028ebaca34bd5ddfb740d5498ee39
sonar.tests=src/test/scala
sonar.sourceEncoding=UTF-8
sonar.scala.version=2.12
sonar.modules=moduleA, moduleB, moduleC

moduleA.sonar.projectName=moduleA
moduleA.sonar.sources=domain/moduleA/src
moduleB.sonar.projectName=moduleB
moduleB.sources=domain/moduleB/src
moduleC.sonar.projectName=moduleC
moduleC.sonar.sources=domain/moduleC/src

While this looks good, I am getting the following error:虽然这看起来不错,但我收到以下错误:

[error] (moduleA / sonarScan) Not authorized. Please check the properties sonar.login and sonar.password.

The login and password error is a bit weird because Sonarqube is behind OneLogin so I don't have any issues scanning the other projects that use Maven and Java/Kotlin.登录名和密码错误有点奇怪,因为 Sonarqube 在 OneLogin 后面,所以我在扫描其他使用 Maven 和 Java/Kotlin 的项目时没有任何问题。

How can I get this running?我怎样才能让它运行?

Managed to solve the issue with sbt sonarScan -Dsonar.java.binaries=target .设法解决了sbt sonarScan -Dsonar.java.binaries=target With this, the sonar-project.properties is (apparently!) not needed.有了这个, sonar-project.properties是(显然!)不需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Scala多模块项目? - Scala multi-module project? 如何设置 sbt/scala/play 多模块项目,它可以与 Intellij scala 插件一起正常工作 - How to setup sbt/scala/play multi-module project which will work fine with Intellij scala plugin IntelliJ:多模块scala(SBT)项目源代码重构 - IntelliJ: multi-module scala (SBT) project source code refactoring 在多模块sbt项目中应在哪里设置scala和Java版本? - Where do set scala and java versions in a multi-module sbt project? Sbt Multi-Module-将某个项目用作另一个项目中的模块 - Sbt Multi-Module - using some project as module in another project 如何在多模块构建中的两个Scala.js跨项目之间建立依赖关系? - How to set up a dependency between two Scala.js cross-projects in a multi-module build? 如何仅在多模块gradle项目中编译仅更改(或相关)的模块 - How to just compile only changed (or related) module in multi-module gradle project 我的scala-maven-plugin与多模块项目的配置不允许我在子目录中执行'mvn compile' - my configuration of scala-maven-plugin with multi-module project doesn't let me do 'mvn compile' in a sub directory 使用 SonarQube 5.4 进行 Scala 分析 - Scala analysis with SonarQube 5.4 如何参考外部本地sbt项目设置多模块构建? - How to set up multi-module build with reference to external local sbt project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM