All files are still parsed by check style parser even if there is none of any activated checkstyle rule?


SonarQube 8.4
SonarQube Scanner
Java 11.0.3 AdoptOpenJDK (64-bit)
Windows 10 10.0 amd64

First of all, My default Quality Profile doesn’t have any rules from Checkstyle repository. None of any these rules is activated.

Then, I run scanner manually, the following is the detail log. I can understand why it is failed.

There is some special characters in the comment line in one specific java source file. And the failed to parse it. (After deleting those characters, the whole execution is success)

My question is Why the parser is still executed if none related rules activated?

E:\download\1216\eipis-user>D:\tools\sonar-scanner-\bin\sonar-scanner.bat -Dsonar.projectKey=finance:eipis-user:FIN-11727 -Dsonar.projectName=finance:eipis-user:FIN-11727   -Dsonar.sourceEncoding=UTF-8 -Dsonar.login=c0daf42489939f83e513055af2c64bd92dae3bc1 -Dsonar.projectVersion=FIN-11727 -Dsonar.language=java  
INFO: Scanner configuration file: D:\tools\sonar-scanner-\bin\..\conf\
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\joechin\.sonar\cache
INFO: SonarQube server 8.4.2
INFO: Default locale: "zh_CN", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=53ms
INFO: Server id: 9CFC3560-AXNvfctKgKTBb8pQWi8a
INFO: User cache: C:\Users\joechin\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=32ms
INFO: Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
INFO: Load/download plugins (done) | time=84ms
INFO: Process project properties
INFO: Process project properties (done) | time=6ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=4ms
INFO: Project key: finance:eipis-user:FIN-11727
INFO: Base dir: E:\download\1216\eipis-user
INFO: Working dir: E:\download\1216\eipis-user\.scannerwork
INFO: Load project settings for component key: 'finance:eipis-user:FIN-11727'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=52ms
INFO: Load active rules
INFO: Load active rules (done) | time=650ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/*.png, **/*.gz, **/*.avro, **/*.ico, **/*.jpg, **/*Test*, **/*test*, **/*.css, **/vendor/**, **/*, **/*.scss, **/, **/*.xml, **/document/**, **/protobuf/**, **/entity/**, **/vo/**, **/model/**, **/dto/**, **/util/**, **/enums/**, **/mapper/**, **/filter/**, **/listener/**, **/config/**, **/exception/**, **/staging/**, **/node_modules/**, **/*.ts, **/*.tsx
INFO:   Excluded sources for coverage: **/entity/**, **/vo/**, **/model/**, **/dto/**, **/util/**, **/enums/**, **/mapper/**, **/filter/**, **/listener/**, **/config/**, **/common/**, **/exception/**, **/starter/**, **/scheduler/**, **/facade/**, **/dao/**, **/constant/**, **/nr/**/config/**, **/nr/**/components/**, **/nr/**/controller/**, **/nr/**/api/**, **/nr/**/dao/**, **/nr/**/model/**, **/nr/**/vars/**, **/nr/**/enums/**, **/nr/**/dto/**, **/nr/**/vo/**, **/nr/**/exception/**
INFO:   Excluded sources for duplication: **/maodou/**/log/**, **/maodou/**/utils/**, **/maodou/**/util/**, **/xinche/**/log/**, **/xinche/**/utils/**, **/xinche/**/util/**
INFO: 672 files indexed
INFO: 893 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for java: Sonar-android
INFO: Quality profile for web: Sonar way
INFO: ------------- Run sensors on module finance:eipis-user:FIN-11727
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=25ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/joechin/.sonar/cache/52f5340dd05620cd162e2b9a45a57124/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor MySensor [javacustom]
INFO: Sensor MySensor [javacustom] (done) | time=2ms
INFO: Sensor JavaSquidSensor [java]
INFO: Configured Java source version ( 8
INFO: JavaClasspath initialization
WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using property.
INFO: JavaClasspath initialization (done) | time=8ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=1ms
INFO: Java Main Files AST scan
INFO: 627 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=8ms
WARN: locking FileBasedConfig[C:\Users\joechin\.config\jgit\config] failed after 5 retries
INFO: 229/627 files analyzed, current file: service/src/main/java/com/guazi/finance/eipis/user/service/va/impl/
INFO: 627/627 source files have been analyzed
INFO: Java Main Files AST scan (done) | time=19560ms
INFO: Java Test Files AST scan
INFO: 0 source files to be analyzed
INFO: Java Test Files AST scan (done) | time=1ms
INFO: Java Generated Files AST scan
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Java Generated Files AST scan (done) | time=1ms
INFO: 0/0 source files have been analyzed
INFO: Sensor JavaSquidSensor [java] (done) | time=19669ms
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: 26 source files to be analyzed
INFO: 26/26 source files have been analyzed
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=4249ms
INFO: Sensor PmdSensor [pmd]
INFO: Sensor PmdSensor [pmd] (done) | time=0ms
INFO: Sensor EndSensor [javacustom]
INFO: Sensor EndSensor [javacustom] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
WARN: No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='ut/target/site/jacoco-aggregate/jacoco.xml'. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [E:\download\1216\eipis-user\target\surefire-reports]
INFO: Sensor SurefireSensor [java] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=3ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=237ms
INFO: Sensor CheckstyleSensor [checkstyle]
INFO: Checkstyle output report: E:\download\1216\eipis-user\.scannerwork\checkstyle-result.xml
INFO: Checkstyle configuration: E:\download\1216\eipis-user\.scannerwork\checkstyle.xml
INFO: Checkstyle charset: UTF-8
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 30.950s
INFO: Final Memory: 23M/108M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Can not execute Checkstyle
        at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader(
        at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(
        at org.sonar.plugins.checkstyle.CheckstyleSensor.execute(
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
        at org.sonar.core.platform.ComponentContainer.startComponents(
        at org.sonar.core.platform.ComponentContainer.execute(
        at org.sonar.scanner.scan.ProjectScanContainer.scan(
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
        at org.sonar.core.platform.ComponentContainer.startComponents(
        at org.sonar.core.platform.ComponentContainer.execute(
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
        at org.sonar.core.platform.ComponentContainer.startComponents(
        at org.sonar.core.platform.ComponentContainer.execute(
        at org.sonar.batch.bootstrapper.Batch.doExecute(
        at org.sonar.batch.bootstrapper.Batch.execute(
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(
        at org.sonarsource.scanner.cli.Main.execute(
        at org.sonarsource.scanner.cli.Main.execute(
        at org.sonarsource.scanner.cli.Main.main(
Caused by: Exception was thrown while processing E:\download\1216\eipis-user\service\src\main\java\com\democom\finance\eipis\user\service\impl\
        at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader(
        ... 32 more
Caused by: IllegalStateException occurred while parsing file E:\download\1216\eipis-user\service\src\main\java\com\democom\finance\eipis\user\service\impl\
        ... 34 more
Caused by: java.lang.IllegalStateException: E:\download\1216\eipis-user\service\src\main\java\com\democom\finance\eipis\user\service\impl\ expecting RCURLY, found 'null'
        ... 38 more
Caused by: E:\download\1216\eipis-user\service\src\main\java\com\democom\finance\eipis\user\service\impl\ expecting RCURLY, found 'null'
        at antlr.Parser.match(
        ... 40 more
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.


I tried to follow up the stack info, but it is too complicated for me right now:(

Any brief up about this execution will be highly appreciated.

Is there anyway to deactivate the check by so-called CheckstyleSensor?

Hey there.

I’d go ask over at checkstyle/sonar-checkstyle – they support this plugin.

I think You miss my point. Actually, I prefer not to run this plugin.

Why is it still executed if I don’t activate any rule about it?

In my case, I didn’t want any style check, I thought this parse-error shouldn’t fail the whoel execution.

If you prefer not to run it – I suggest uninstalling it!

If it runs when you don’t want it to/fails in a way you think it shouldn’t, you should get in touch with the maintainers (plugin code determines when it runs and how it fails)

You are right. After uninstalling the plugin, the same execution succeed.

As long as you install a plugin, which is checkstyle-sonar-plugin-8.37.jar in my case, even if you don’t active any related rule, some related logic, which I’m not sure which is which, will still be executed.

So the best choose is just to uninstall it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.