1

我正在使用sonar-checkstyle-plugin-2.5-SNAPSHOT,我创建了一个名为 Checkstyle 的质量配置文件并激活了所有规则,每次在 checkstyle 阶段执行都会停止。我尝试通过仅使用 checkstyle 存储库中的 1 条规则再次执行此操作,认为这可能是一些正在执行此操作的规则。但这也没有用。只有在没有启用规则时才成功执行时间。

我是 sonarqube 的新手,急需帮助。

这是我的执行日志:

D:\SONAR_QUBE\sonar-scanner-2.5.1\bin\..
INFO: Scanner configuration file: D:\SONAR_QUBE\sonar-scanner-2.5.1\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\sonar-project.properties
INFO: SonarQube Scanner 2.5.1
INFO: Java 1.8.0_73 Oracle Corporation (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:\Users\IC020829\.sonar\cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=184ms
INFO: User cache: C:\Users\IC020829\.sonar\cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=10ms
INFO: SonarQube server 5.3
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=27ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Apply project exclusions
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=50ms
INFO: Load active rules
INFO: Load active rules (done) | time=1825ms
INFO: SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
INFO: Publish mode
INFO: -------------  Scan Ashu_Test_Project
INFO: Language is forced to java
INFO: Load server rules
INFO: Load server rules (done) | time=1055ms
INFO: Base dir: D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple
INFO: Working dir: D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\.sonar
INFO: Source paths: src
INFO: Source encoding: windows-1252, default locale: en_US
INFO: Index files
INFO: 2 files indexed
INFO: Quality profile for java: CheckStyle
INFO: JaCoCoSensor: JaCoCo report not found : D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\target\jacoco.exec
INFO: JaCoCoItSensor: JaCoCo IT report not found: D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\target\jacoco-it.exec
INFO: Sensor JavaSquidSensor
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization...
INFO: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property
INFO: JavaClasspath initialization done: 0 ms
INFO: JavaTestClasspath initialization...
INFO: Bytecode of dependencies was not provided for analysis of test files, you might end up with less precise results. Bytecode can be provided using sonar.java.test.libraries property
INFO: JavaTestClasspath initialization done: 0 ms
INFO: Java Main Files AST scan...
INFO: 2 source files to be analyzed
INFO: Java Main Files AST scan done: 1592 ms
INFO: Java bytecode has not been made available to the analyzer. The org.sonar.java.bytecode.visitor.DependenciesVisitor@615b5480 are disabled.
INFO: Java Test Files AST scan...
INFO: 0 source files to be analyzed
INFO: Java Test Files AST scan done: 0 ms
INFO: Sensor JavaSquidSensor (done) | time=2574ms
INFO: Sensor Lines Sensor
INFO: 2/2 source files have been analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor Lines Sensor (done) | time=2ms
INFO: Sensor QProfileSensor
INFO: Sensor QProfileSensor (done) | time=61ms
INFO: Sensor SurefireSensor
INFO: parsing D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\target\surefire-reports
INFO: Sensor SurefireSensor (done) | time=0ms
INFO: Sensor SmellMeasuresSensor
INFO: Sensor SmellMeasuresSensor (done) | time=149ms
INFO: Sensor CheckstyleSensor
INFO: Execute Checkstyle 6.12.1...
INFO: Checkstyle configuration: D:\Ashu\sonar-examples-master\projects\languages\java\sonar-runner\java-sonar-runner-simple\.sonar\checkstyle.xml
INFO: Checkstyle charset: windows-1252
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/InputStream;)V
        at com.puppycrawl.tools.checkstyle.PackageNamesLoader.getPackageNames(PackageNamesLoader.java:156)
        at com.puppycrawl.tools.checkstyle.Checker.finishLocalSetup(Checker.java:137)
        at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:134)
        at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:84)
        at org.sonar.plugins.checkstyle.CheckstyleSensor.analyse(CheckstyleSensor.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.PhaseExecutor.execute(PhaseExecutor.java:98)
        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
        at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
        at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
        at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
        at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
        at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
        at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:133)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:82)
        at org.sonarsource.scanner.cli.Main.main(Main.java:66)
4

1 回答 1

0

我也见过很多次这样的问题。这通常发生在您的系统在受限访问或具有限制或限制的代理设置的环境中工作时。

另一方面,我认为您面临的问题是因为兼容性冲突。这是找到要在 SonarQube 中配置的Checkstyle兼容版本的链接。

http://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix

对我来说,如果您的插件与您的 SonarQube 不兼容,那么 Sonar 不应该启动,但我可以看到您已成功启动它并继续进行质量配置文件和分析您的项目的步骤。

于 2016-05-06T11:20:11.320 回答