4

I have upgraded my sonar java plugin to 3.7. We use inbuilt jacoco plugin to do the code coverage. We use the maven target org.jacoco:jacoco-maven-plugin:prepare-agent and sonar:sonar to get a sonar build triggered from jenkins job. However post the upgrade i am getting the below error:

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

Below is the plugins details installed with my SonarQube version 5.1.2:

  • Java 3.7
  • LDAP 1.3
  • Git 1
  • SVN 1
  • Cobertura 1.6.3

We are not using cobertura. Instead using inbuilt jacoco as mentioned above.

We are using sonar-maven-plugin:2.7.1.

agabrys
  • 8,728
  • 3
  • 35
  • 73
nishat
  • 947
  • 2
  • 8
  • 15

0 Answers0