Getting parse error with java when scanning source files with SQ

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Is it due to Checkstyle Plugin as its running on version 4.21??

SQ version:–7.9.4
Scanner :— 4.6.0.2311
Plugin:–

12:39:47 07:09:47.779 DEBUG: ‘uiv-core/src/main/java/com/nokia/nsw/uiv/validator/utils/UpdateTrigger.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.798 DEBUG: ‘uiv-core/src/test/java/package-info.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.815 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/adapterName.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.845 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/adapterName.java’
12:39:47 07:09:47.845 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.847 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/common/__adapterName__Configuration.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.864 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/common/__adapterName__Configuration.java’
12:39:47 07:09:47.864 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.866 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/preprocessor/__adapterName__FileHeaderProcessor.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.884 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/preprocessor/__adapterName__FileHeaderProcessor.java’
12:39:47 07:09:47.884 ERROR: Parse error at line 4 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.885 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/collector/__adapterName__Collector.java’ generated metadata with charset ‘UTF-8’
12:39:48 07:09:47.908 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/collector/__adapterName__Collector.java’
12:39:48 07:09:47.908 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected

Hi @rohit_jalal ,

Are you using Checkstyle Plugin version 4.21? Try updating to version 8.40.0 and try it again, see https://github.com/checkstyle/sonar-checkstyle for more info.

Joe