-
Notifications
You must be signed in to change notification settings - Fork 10
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
NoSuchMethodError with SonarQube 6 #6
Comments
I have the same error after activating the plugin in sonar 6.7. |
The problem comes from this line. Same problem here on sonar 7.0. We can see that in 6.7 it says that So, all in all, I believe the fix would be something like: final Resource resource;
// ...
resource = org.sonar.api.resources.File.fromIOFile(file, project); final DefaultInputFile inputFile;
// ...
InputFile file = org.sonar.api.batch.fs.inputFile(fs.predicates().hasRelativePath(file.path())); There will be of course other changes (signatures...) to be done. But that should not take more than a day to whoever wants to fix it (and knows a bit of Java/the codebase). |
I would put this as top-priority as this means the whole plugin cannot be used in sonar 6.0+. And the LTS is 6.7. |
@Mulugruntz you may like to try https://github.com/SonarOpenCommunity/sonar-cxx instead |
The plugin does not work with SonarQube version 6.4 and sonar scanner 3.0.3.778. It seems that one API was removed.
14:29:11.505 ERROR: Error during SonarQube Scanner execution java.lang.NoSuchMethodError: org.sonar.api.resources.File.fromIOFile(Ljava/io/File;Lorg/sonar/api/resources/Project;)Lorg/sonar/api/resources/File; at org.sonarqube.cppcheck.CppcheckSensor.save(CppcheckSensor.java:103) at org.sonarqube.cppcheck.CppcheckSensor.saveAll(CppcheckSensor.java:80) at org.sonarqube.cppcheck.CppcheckSensor.analyse(CppcheckSensor.java:73) at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:87) at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:81) at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:67) at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:75) at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129) at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:259) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:254) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129) at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47) at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129) at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118) at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117) at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63) 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.$Proxy0.execute(Unknown Source) at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233) at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151) at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123) at org.sonarsource.scanner.cli.Main.execute(Main.java:77) at org.sonarsource.scanner.cli.Main.main(Main.java:61)
The text was updated successfully, but these errors were encountered: