0

Project has structure: enter image description here

my-project
  
  |--base
      |--src
      |--target
      |--pom
  |--uiFramework
      |--src
      |--target
      |--pom
  |--apiFramework
      |--src
      |--target
      |--pom
  |--uiJourneyTemplate
      |--src
      |--target
      |--pom
|--pom
|--sonar-project.properties

where POM file has:

<modules>
    <module>base</module>
    <module>uiFramework</module>
    <module>uiJourneyTemplate</module>
    <module>apiFramework</module>
</modules>

Each module in POM file has parent section.

in the main folder sonar-properties file has:

sonar.sourceEncoding=UTF-8
sonar.projectKey=com.java.framework:FRAMEWORK
sonar.sources=src
sonar.java.binaries=**/*
sonar.exclusions=**/*.js, uiJourneyTemplate/**/*
#sonar.java.libraries=**/*.jar

#List of module identifiers
sonar.modules=base,uiFramework,apiFramework

#base settings
base.sonar.projectName=com.java.framework:base
module1.sonar.sources=src/main/java

#uiFramework settings
uiFramework.sonar.projectName=com.java.framework:uiFramework
uiFramework.sonar.sources=src/main/java

#apiFramework settings
apiFramework.sonar.projectName=com.java.framework:apiFramework
apiFramework.sonar.sources=src/main/java

I tries different variations.

In the result I see that in sonar I have only one java file form base module and POM files from each modules: in the console for others java file I have:

ERROR: Unable to create symbol table for : 'uiFramework/src/main/java/utils/waitings/SmartWait.java'
java.lang.IllegalArgumentException: Unsupported class file major version 61

the same for ALL others classes

what can u recommend?

thanks

SOLVED: problem is: NOT possible to use JAVA 17 with SOnarQube 7.9.1 for now - need to use JAVA 11 and will work fine! https://community.sonarsource.com/t/sonarqube-only-pom-files-push-to-sonar-for-multi-modules-project/57369/4

  • Does this answer your question? [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Jens Jan 31 '22 at 19:22
  • @Jens hi, thanks for answering, no, problem is not with JAVA, smith with sonar configuration 100% – Dima Ananjev Jan 31 '22 at 19:25
  • You shouldn't use `sonar-project.properties` for Maven project. Remove the file, execute the scan and it should work OOTB. – agabrys Jan 31 '22 at 23:01
  • @agabrys it doesn't help - the same. My command is: /Users/myUser/Downloads/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner \ -Dsonar.projectKey=FRAMEWORK \ -Dsonar.host.url=url \ -Dsonar.login=login \ -Dsonar.java.binaries=**/target/classes \ Dsonar.exclusions=**/*.js,uiJourneyTemplate/**/*,uiFramework/src/test/java/**/* \ -Dsonar.java.libraries=**/*.jar – Dima Ananjev Feb 01 '22 at 05:33
  • You have Maven, so use it. [SonarScanner for Maven](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/). – agabrys Feb 01 '22 at 20:17
  • SOLVED: problem is: NOT possible to use JAVA 17 with SOnarQube 7.9.1 for now - need to use JAVA 11 and will work fine! https://community.sonarsource.com/t/sonarqube-only-pom-files-push-to-sonar-for-multi-modules-project/57369/4 – Dima Ananjev Feb 02 '22 at 10:23

0 Answers0