java – 使用kafka(或scala一般?)时sonarqube扫描的异常?

我有一个使用kafka的java项目.我用sonarqube 5.0(声纳maven插件2.5)扫描它,我得到这个:

[INFO] [13:48:22.488] Sensor JavaSquidSensor...
[INFO] [13:48:22.511] Java Main Files AST scan...
[INFO] [13:48:22.512] 8 source files to be analyzed
[ERROR] [13:48:22.655] Class not found: scala.Predef$$less
[ERROR] [13:48:22.655] Class not found: scala.Predef$$less$colon
[ERROR] [13:48:22.680] Class not found: scala.collection.immutable.Stream$$hash
[ERROR] [13:48:22.680] Class not found: scala.collection.immutable.Stream$$hash$colon
[ERROR] [13:48:22.685] Unable to create symbol table for : /path/to/KafkaNotifier.java
java.lang.IllegalStateException: Innerclass: colon and classSymbol: Stream are not the same.
    at com.google.common.base.Preconditions.checkState(Preconditions.java:145) ~[sonar-batch-maven-compat-5.0.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor.defineInnerClass(BytecodeVisitor.java:162) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor.visitInnerClass(BytecodeVisitor.java:144) ~[java-squid-2.9.1.jar:na]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:679) ~[asm-debug-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:506) ~[asm-debug-all-5.0.3.jar:5.0.3]
    at org.sonar.java.resolve.BytecodeCompleter.complete(BytecodeCompleter.java:100) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.Symbol.complete(Symbol.java:98) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor$ReadType.visitEnd(BytecodeVisitor.java:541) ~[java-squid-2.9.1.jar:na]
...lots more ommitted

我为每个使用kafka的课程都能得到这个.

我错过了配置吗?

这是一个鱿鱼虫吗?

解决方法:

在我看来,你正在点击这个报告的字节码加载器的错误:http://jira.codehaus.org/browse/SONARJAVA-805

在使用Scala时会触发更多内容,Scala会在其名称中生成许多带有$的类.

上一篇:Kubernetes AdmissionWebhook匹配请求


下一篇:以VuePress的v1.x为基础开发-用户手册