java - SonarQube无法分析文件:Java文件

原文 标签 java jenkins sonarqube

org.sonar.squidbridge.api.AnalysisException:SonarQube无法分析文件Java文件

我正在使用SonarQube 5.6.1版本

这些是我的属性,并且已经使用Java 8:

sonar.projectKey=Project1
sonar.projectName=ProProject
sonar.projectVersion=Layer1
sonar.verbose=true
sonar.sources=src
sonar.qualitygate=SonarQube way 
sonar.libraries=lib
sonar.tests=Tests
sonar.issuesReport.html.enable=true
sonar.issuesReport.console.enable=true 
sonar.analysis.mode=publish
sonar.issuesReport.console.enable=true
sonar.sourceEncoding=UTF-8


在我的sonarQube分析期间,我的java代码中出现了这样的错误。

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(AccessController.java:594)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '/application/scanner/jenkins/workspace/Test/src/Cases/address/PerAddress.java'
    at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:93)
    at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
    at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:133)
    at org.sonar.java.JavaSquid.scan(JavaSquid.java:126)
    at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:93)
    at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
    at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
    at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    ... 9 more
Caused by: java.lang.NullPointerException
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:212)
    at org.sonar.java.se.ProgramState.decreaseReference(ProgramState.java:212)
    at org.sonar.java.se.ProgramState.cleanupDeadSymbols(ProgramState.java:256)
    at org.sonar.java.se.ExplodedGraphWalker.cleanUpProgramState(ExplodedGraphWalker.java:241)
    at org.sonar.java.se.ExplodedGraphWalker.handleBlockExit(ExplodedGraphWalker.java:249)
    at org.sonar.java.se.ExplodedGraphWalker.execute(ExplodedGraphWalker.java:199)
    at org.sonar.java.se.ExplodedGraphWalker.visitMethod(ExplodedGraphWalker.java:152)
    at org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:218)
    at org.sonar.java.se.SymbolicExecutionVisitor.visitNode(SymbolicExecutionVisitor.java:49)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:95)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:78)
    at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:64)
    at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:120)
    at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)
    ... 39 more
ERROR: 
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Execute SonarQube Scanner' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Notifying upstream projects of job completion
Finished: FAILURE


有什么我想念的吗

最佳答案

可能已经在SonarQube is unable to analyze file (NullPointerException)中得到了答案,具体取决于您所使用的sonar-java插件的版本。

关于java - SonarQube无法分析文件:Java文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44701708/

相关文章:

java - 未调用 Spring Boot RequestMapping 方法

java - Spring3.1 CORS。这段代码是什么意思?我不明白为什么作者使用 'semi-colon' 到那个位置

java - JMeter HTTP 请求挂起(可能在过载的网络上)

spring-boot - Spring Boot Docker容器立即退出并显示代码1

java - 配置 Velocity 以在未定义的 $variable 上失败

java - 如何使用 AbstractAjaxTimerBehavior 对 Wicket 组件进行单元测试?

plugins - 在Jenkins插件开发中,什么是Stapler(org.kohsuke.stapler.Stapler)?

.net-core - SonarQube dotnet 核心 : how to avoid the duplicate guid error without altering the default build task

java - 编写与Java变量声明相关的自定义规则

java - 如何禁用SQUID :UnusedProtectedMethod in Sonar for a class or method?