1. ホーム
  2. sonarqube

[解決済み] SonarQubeによる複数モジュールのプロジェクト解析

2022-02-17 16:34:21

質問

SonarQube Server 5.1.2, Sonar-Runner 2.4

で提供されているように マルチモジュールプロジェクト 私は、次のようなプロジェクト構造を作成しました。

Accounts
|
->invoice
  |
   ->src

->receipt
  |
   ->src

->sonar.properties

ファイル:sonar.properties

sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0

sonar.sources=src

sonar.modules=invoice,receipt

invoice.sonar.projectName=Invoice
receipt.sonar.projectName=Receipt

sonar-runnerで上記の設定で実行すると、 "Account" ディレクトリに "src" フォルダがないというエラーが発生します。この設定が、このリンクで利用できるconfと同じであることを望みます。もし、この設定に問題がなければ、InvoiceとReceiptは以下のように表示されるはずです。 サブプロジェクト アカウントプロジェクトの下に、複数のモジュール/プロジェクトを1つのプロジェクトで実現するには、上記の構成でどのような変更が必要ですか?

エラー

ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: The folder 'src' does not exist for 'org.mycompany.acc' (base directory = C:\Users\xyz\Accounts\.) ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t he -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

解決方法は?

これを試してみてください。

sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0

sonar.sources=src # try to remove this by the way if you don't have suchdirectory under root folder of project

sonar.modules=invoice,receipt

invoice.sonar.projectName=Invoice
invoice.sonar.sources=invoice/src
receipt.sonar.projectName=Receipt
receipt.sonar.sources=receipt/src