Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkstyle-sonar-plugin does not work with sonar 4.5.2 and 4.5.4 require upgrade to 5.6.4 #52

Closed
romani opened this issue Dec 25, 2016 · 2 comments
Assignees
Milestone

Comments

@romani
Copy link
Member

romani commented Dec 25, 2016

result of mvn sonar:sonar

Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.classpath()Ljava/util/Collection;
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:~/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.2/sonar-maven-plugin-3.2.jar
urls[1] = file:~/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
urls[2] = file:~/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[3] = file:~/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
urls[4] = file:~/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[5] = file:~/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[6] = file:~/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
urls[7] = file:~/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.8/sonar-scanner-api-2.8.jar
urls[8] = file:~/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
urls[9] = file:~/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:181)
	... 21 more
Caused by: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.classpath()Ljava/util/Collection;
	at org.sonar.plugins.checkstyle.CheckstyleExecutor.createClassloader(CheckstyleExecutor.java:111)
	at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:66)
	at org.sonar.plugins.checkstyle.CheckstyleSensor.analyse(CheckstyleSensor.java:58)
	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:119)
	at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:194)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
	at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:233)
	at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
	at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:226)
	at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:221)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
	at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:64)
	at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:51)
	at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:125)
	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
	at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
	at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:173)
	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.executeOldVersion(BatchIsolatedLauncher.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy23.executeOldVersion(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:238)
	at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
	at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
	at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:122)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
@romani
Copy link
Member Author

romani commented Dec 25, 2016

Sonar 4.5.4 use sonar-java-plugin-2.4.jar , required method appear in sonar-java-plugin-4.4.jar - SonarSource/sonar-java@f9f6273

So we need to upgrade to higher LST release 5.6.4.
mapping should be updated too, as from 3.1 it has to use 5.6.4 as minimum.

@romani romani self-assigned this Dec 25, 2016
@romani romani changed the title checkstyle-sonar-plugin does not work with sonar 4.5.2 and 4.5.4 checkstyle-sonar-plugin does not work with sonar 4.5.2 and 4.5.4 require upgrade to 5.6.4 Dec 27, 2016
romani added a commit that referenced this issue Dec 27, 2016
@romani
Copy link
Member Author

romani commented Dec 27, 2016

upgraded to 5.6.4 sonar API in compile time.

but releases 3.1 - 3.3 works fine in 5.6.4 .

@romani romani closed this as completed Dec 27, 2016
@romani romani added this to the 3.4 milestone Dec 27, 2016
tsjensen pushed a commit to checkstyle-addons/sonar-checkstyle that referenced this issue Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant