Please suggest different options.
Must-share information (formatted with Markdown):
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube: 8.9.10. Scanner:CLI 4.0 Maven Plugin: 3.9.1 -
what are you trying to achieve
We want to resolve out of memory heap space issue. We were not able to find a right place to define Maven_Opts or Scanner_Opts. Added the scripting blocks we used in the next question. There are many files in the codebase to be scanned hence this out of memory error. -
what have you tried so far to achieve this
sonar container block:
stage('Analyze: SonarQube') {
container('maven') {
withSonarQubeEnv('SonarQube') {
warnError('SonarQube Quality Gate FAILED') {
sh """
mvn --activate-profiles pipeline \
--batch-mode \
--define revision=$deployVersion \
--define server.username=\$AUSER \
--define server.password=\$APW \
sonar:sonar
unset MAVEN_OPTS
"""
}
}
}
milestone 30
}
We tried setting Maven_Opts with export option in the above block. Also defining it in the container template.
containerTemplate(
name: 'sonar',
image: 'sonarsource/sonar-scanner-cli:4',
envVars: [
containerEnvVar(key: "SONAR_SCANNER_OPTS", value: "-Xmx10240m" )
],
command: 'sleep',
args: '1h'
)