AEM sonar-project.properties UI & Java Maven Project scan

Sonarcube community version 6.7.5
we want to scan css/Javascript/typescript along with Java code, but we have java code alone added in current sonar-project.proeprties like below, but how can i add UI sub Project into this properties file to scan while doing build through jenkin.
Need help to update UI subproject in sonar-project.properties file.

==Required metadata==
sonar.projectKey=AemProject.core
sonar.projectName=AemProject - Core
sonar.projectVersion=1.0.0

==Comma-separated paths to directories with sources (required)==
sonar.sources=core/src/main

==Language==
sonar.language=java
sonar.java.binaries=core/target/classes

==Encoding of the source files==
sonar.sourceEncoding=UTF-8

Welcome :slight_smile:

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

6.7.5 → 7.9.6 → 8.9.10 → 9.9.4 → 10.4 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

1 Like

Hi Rebse,
Thanks for the update.
Can we upgrade from 6.7.5 to 9.8 version without java upgrade ( currently java 1.8)?

Hi,

to be clear, supported versions are
Sonarqube 9.9.4 LTS
Sonarqube 10.4.1 latest

so it makes no sense to update to version 9.8

The machine Sonarqube runs on will need to have an update of its java version, as
Sonarqube 9.9.4 LTS needs to run with Java 17 (so does Sonarqube 10.4.1 latest), see

Usually the Sonarqube server runs on a dedicated machine and the Sonarqube analysis runs local or on CI server like i.e. Jenkins.

The Sonarqube analysis against
Sonarqube 9.9.4 LTS needs to run with Java 11 or Java 17
Sonarqube 10.4.1 latest needs to run with Java 17

If you’re in doubt if projects compiled with/for Java 8 may still be analysed with newer Sonarqube versions, yes that will work fine.

From your given sonar.java.binaries settings

two things spring to mind.
If using the sonar maven plugin, see

there’s no need to set those properties, as those will automatically be set by the sonar maven plugin.

You may split your maven cli calls like that in your Jenkins pipeline, i.e.

this may run with Java 8 for compilation

withMaven(jdk: ..., maven: ..., globalMavenSettingsConfig: ...) {
  sh 'mvn clean install'
}

but this has to run with Java 11 or 17 (if using Sonarqube 9.9.4 LTS) or Java 17( if using Sonarqube 10.4.1) and nodejs 20 (requirement for css) is recommended

nodejs(configId: ..., nodeJSInstallationName: 'nodejs-20') {
  withSonarQubeEnv(...) {
    withMaven(jdk: 'java-17-openjdk', maven: ..., globalMavenSettingsConfig: ...) {
      sh 'mvn sonar:sonar'
    }
  }
}

Gilbert

Hi Rebhan,
Thanks for the update, we will keep you posted if any issues once we upgraded to 9.9.4.

Regards
Raju