今天我们将SonarQube Java插件从3.2升级到了3.3(http://docs.sonarqube.org/display/PLUG/Java+Plugin)。现在分析以失败告终:
13:59:10 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project ingbol: SonarQube is unable to analyze file : '/var/lib/jenkins/workspace/ing_trunk_sonar/sources/cib-actions/src/main/java/com/company/cib/corpo/struts/actions/IngCcsRightsAction.java': org.sonar.java.model.expression.MethodInvocationTreeImpl cannot be cast to org.sonar.plugins.java.api.tree.IdentifierTree -> [Help 1]
13:59:10 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project ingbol: SonarQube is unable to analyze file : '/var/lib/jenkins/workspace/ing_trunk_sonar/sources/cib-actions/src/main/java/com/company/cib/corpo/struts/actions/IngCcsRightsAction.java'
13:59:10 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
13:59:10 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
13:59:10 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
13:59:10 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
13:59:10 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
13:59:10 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
13:59:10 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
13:59:10 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
13:59:10 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
13:59:10 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
13:59:10 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
13:59:10 at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
13:59:10 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:59:10 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:59:10 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:59:10 at java.lang.reflect.Method.invoke(Method.java:497)
13:59:10 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
13:59:10 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
13:59:10 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
13:59:10 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
13:59:10 Caused by: org.apache.maven.plugin.MojoExecutionException: SonarQube is unable to analyze file : '/var/lib/jenkins/workspace/ing_trunk_sonar/sources/cib-actions/src/main/java/com/company/cib/corpo/struts/actions/IngCcsRightsAction.java'
13:59:10 at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
13:59:10 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
13:59:10 at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
13:59:10 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
13:59:10 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
13:59:10 ... 19 more
13:59:10 Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '/var/lib/jenkins/workspace/ing_trunk_sonar/sources/cib-actions/src/main/java/com/company/cib/corpo/struts/actions/IngCcsRightsAction.java'
13:59:10 at org.sonar.java.ast.AstScanner.simpleScan(AstScanner.java:114)
13:59:10 at org.sonar.java.ast.AstScanner.scan(AstScanner.java:75)
13:59:10 at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:132)
13:59:10 at org.sonar.java.JavaSquid.scan(JavaSquid.java:125)
13:59:10 at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:86)
13:59:10 at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)
13:59:10 at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)
13:59:10 at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)
13:59:10 at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
13:59:10 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
13:59:10 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
13:59:10 at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
13:59:10 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
13:59:10 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
13:59:10 at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
13:59:10 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
13:59:10 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
13:59:10 at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
13:59:10 at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
13:59:10 at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
13:59:10 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
13:59:10 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
13:59:10 at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
13:59:10 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
13:59:10 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
13:59:10 at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
13:59:10 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:59:10 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:59:10 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:59:10 at java.lang.reflect.Method.invoke(Method.java:497)
13:59:10 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
13:59:10 at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
13:59:10 at java.security.AccessController.doPrivileged(Native Method)
13:59:10 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
13:59:10 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
13:59:10 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
13:59:10 at org.sonar.runner.api.Runner.execute(Runner.java:100)
13:59:10 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
13:59:10 ... 22 more
13:59:10 Caused by: java.lang.ClassCastException: org.sonar.java.model.expression.MethodInvocationTreeImpl cannot be cast to org.sonar.plugins.java.api.tree.IdentifierTree
13:59:10 at org.sonar.java.checks.StringToStringCheck.extractName(StringToStringCheck.java:92)
13:59:10 at org.sonar.java.checks.StringToStringCheck.onMethodFound(StringToStringCheck.java:71)
13:59:10 at org.sonar.java.checks.methods.AbstractMethodDetection.checkInvocation(AbstractMethodDetection.java:52)
13:59:10 at org.sonar.java.checks.methods.AbstractMethodDetection.visitNode(AbstractMethodDetection.java:43)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:94)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:112)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:96)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:72)
13:59:10 at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:66)
13:59:10 at org.sonar.java.checks.SubscriptionBaseVisitor.scanFile(SubscriptionBaseVisitor.java:33)
13:59:10 at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:121)
13:59:10 at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:67)
13:59:10 at org.sonar.java.ast.AstScanner.simpleScan(AstScanner.java:107)
13:59:10 ... 59 more
13:59:10 [ERROR]
13:59:10 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
13:59:10 [ERROR]
13:59:10 [ERROR] For more information about the errors and possible solutions, please read the following articles:
13:59:10 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
如何解决这个问题?
环境:
- SonarQube 5.1
- SonarQube Java插件3.3
- Jenkins 1.611
- Sonar Runner 2.4