Gradle Sonar plugin broken with Sonar 4.2


(fares.hassak) #1

Hello,

I have this error with Gradle 1.12 and Sonar 4.3.1 :

java.lang.UnsupportedOperationException: Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes

Please, upgrade to Sonar 4.2.

Thanks in advance.

Here the stacktrace (Sorry, pastbin or gist is not available in my compagny )

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:sonarRunner’.

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(Execute ActionsTaskExecuter.java:69)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActions TaskExecuter.java:46)

at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExe cutionAnalysisTaskExecuter.java:35)

at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTask Executer.java:64)

at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExec uter.java:58)

at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmpt ySourceFilesTaskExecuter.java:42)

at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWit hNoActionsExecuter.java:52)

at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExec uter.java:53)

at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMo stOnceTaskExecuter.java:43)

at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java: 289)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(Ab stractTaskPlanExecutor.java:79)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(Ab stractTaskPlanExecutor.java:63)

at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTa skPlanExecutor.java:51)

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.ja va:23)

at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter. java:86)

at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java :29)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)

at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:3 2)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java: 166)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)

at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProces sBuildActionExecuter.java:64)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)

at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute r.java:35)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecute r.java:26)

at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)

at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineA ctionFactory.java:201)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineA ctionFactory.java:174)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFac tory.java:170)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFac tory.java:139)

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33 )

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22 )

at org.gradle.launcher.Main.doAction(Main.java:46)

at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)

at org.gradle.launcher.Main.main(Main.java:37)

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)

at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)

at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by: org.sonar.runner.RunnerException: org.sonar.api.utils.SonarException: Can not execute Che ckstyle

at org.sonar.runner.Runner.delegateExecution(Runner.java:288)

at org.sonar.runner.Runner.execute(Runner.java:151)

at org.sonar.runner.Runner$execute.call(Unknown Source)

at org.gradle.api.sonar.runner.SonarRunner.run(SonarRunner.groovy:52)

at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA ction.doExecute(AnnotationProcessingTaskFactory.java:219)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA ction.execute(AnnotationProcessingTaskFactory.java:212)

at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskA ction.execute(AnnotationProcessingTaskFactory.java:201)

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)

at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteA ctionsTaskExecuter.java:80)

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(Execute ActionsTaskExecuter.java:61)

… 43 more Caused by: org.sonar.api.utils.SonarException: Can not execute Checkstyle

at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:89)

at org.sonar.plugins.checkstyle.CheckstyleSensor.analyse(CheckstyleSensor.java:44)

at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)

at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)

at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:131)

at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:199)

at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:194)

at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:192)

at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:192)

at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:187)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:56)

at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:44)

at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:175)

at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:163)

at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)

at org.sonar.batch.Batch.execute(Batch.java:103)

at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:69)

at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61)

at org.sonar.runner.Runner.delegateExecution(Runner.java:285)

… 54 more Caused by: java.lang.UnsupportedOperationException: Not supported since v4.2. See http://docs.codeha us.org/display/SONAR/API+Changes

at org.sonar.api.resources.JavaFile.unsupported(JavaFile.java:118)

at org.sonar.api.resources.JavaFile.fromAbsolutePath(JavaFile.java:114)

at org.sonar.plugins.checkstyle.CheckstyleAuditListener.initResource(CheckstyleAuditListener .java:93)

at org.sonar.plugins.checkstyle.CheckstyleAuditListener.addError(CheckstyleAuditListener.jav a:81)

at com.puppycrawl.tools.checkstyle.Checker.fireErrors(Checker.java:511)

at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:279)

at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:84)

… 83 more


(Peter Niederwieser) #2

This might be http://issues.gradle.org/browse/GRADLE-3062, but I’m not sure. The errors sounds as if an outdated Sonar Checkstyle plugin was used. Which Sonar plugins are used is controlled by the Sonar server, not by Gradle. Perhaps ask for clarification on the Sonar list.


(fares.hassak) #3

Hi Peter,

You are right. I have updated Checkstyle plugin on Sonar server and it’s working fine !

Thanks for your help.