ソナー Java プラグインを 3.7 にアップグレードしました。組み込みの jacoco プラグインを使用してコード カバレッジを行います。maven ターゲット org.jacoco:jacoco-maven-plugin:prepare-agent および sonar:sonar を使用して、jenkins ジョブからトリガーされたソナー ビルドを取得します。ただし、アップグレードを投稿すると、次のエラーが表示されます。
Caused by: java.lang.IllegalArgumentException: Line must be null or greater than zero (got 0)
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
at org.sonar.api.issue.internal.DefaultIssue.setLine(DefaultIssue.java:251)
at org.sonar.core.issue.DefaultIssueBuilder.build(DefaultIssueBuilder.java:127)
at org.sonar.core.issue.DefaultIssueBuilder.build(DefaultIssueBuilder.java:34)
at org.sonar.java.SonarComponents.addIssue(SonarComponents.java:207)
at org.sonar.java.bytecode.visitor.DefaultBytecodeContext.reportIssue(DefaultBytecodeContext.java:59)
at org.sonar.java.checks.UnusedPrivateMethodCheck.visitMethod(UnusedPrivateMethodCheck.java:74)
at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethod(BytecodeVisitorNotifier.java:68)
at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethodAndFieldAndEdge(BytecodeVisitorNotifier.java:49)
at org.sonar.java.bytecode.BytecodeVisitorNotifier.notifyVisitors(BytecodeVisitorNotifier.java:42)
at org.sonar.java.bytecode.BytecodeScanner.notifyBytecodeVisitors(BytecodeScanner.java:80)
... 57 more
以下は、SonarQube バージョン 5.1.2 でインストールされたプラグインの詳細です。
- Java 3.7
- LDAP 1.3
- ギット 1
- SVN1
- コベルチュラ 1.6.3
コベルチュラは使用していません。代わりに、上記のように組み込みの jacoco を使用します。
sonar-maven-plugin:2.7.1 を使用しています。