简体   繁体   中英

Jhipster CI (Jenkins 2 + Sonarqube) -> Memory Heap

I try to scan Jhipster generated code with Sonarqube during a Jenkins build.

My configuration is the following:

  • Gitlab as Docker Container
  • Jenkins 2 as Docker Container
  • Sonarqube 5.4 (higher is not permitted with MariaDB; right?) as Docker Container

This is a fresh install and all systems are communicating together.

When running builds, Jenkins is alerting about duplicates references in the 'bower_components' repository.

WARN: Too many duplication references on file [moduleKey=Challenge1:0.1-HENDRIX, relative=src/main/webapp/bower_components/angular-i18n/angular-locale_vun-tz.js, basedir=/var/jenkins_home/workspace/Challenge-1] for block at line 20. Keep only the first 100 references.

My problem is that I do not get the reasons why is alerting about it since few exclusions have been set at different levels:

1) Within pom.xml

<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, target/www/**/*.*</sonar.exclusions>

2) Within Jenkinsfile

node {
    ...
    stage 'scan'
    sh "${sonarqubeScannerHome}/bin/sonar-scanner -e -Dsonar.host.url=http://sonarqube:9000 -Dsonar.projectKey=Challenge1:'0.1-HENDRIX' -Dsonar.projectName='Challenge 1' -Dsonar.projectVersion='0.1-HENDRIX' -Dsonar.sources='src/' -Dsonar.coverage.exclusions=**/bower_components/**"
}

3) On sonarqube customizing itself (Analysis Scope).

EDIT: This "non-exclusion" was originally leading to a memory dump that I could solved by extending the memory on sonarqube (sonar.properties).

sonar.web.javaOpts=-Xmx2048m -Xms512m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true

However, I a still am afraid that extending memory isn't the appropriate solution and I must be able to exclude some parts of code. What should I do to remove bower components from the scan analysis? (I probably made something wrong).

我的错误:我使用的是-Dsonar.coverage.exclusions而不是-Dsonar.global.exclusions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM