[英]Jhipster CI (Jenkins 2 + Sonarqube) -> Memory Heap
I try to scan Jhipster generated code with Sonarqube during a Jenkins build. 我尝试在Jenkins构建过程中使用Sonarqube扫描Jhipster生成的代码。
My configuration is the following: 我的配置如下:
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. 运行构建时,Jenkins会警告“ bower_components”存储库中的重复引用。
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.
警告:文件[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]用于第20行的代码块。仅保留前100个引用。
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 1)在pom.xml中
<sonar.exclusions>src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, target/www/**/*.*</sonar.exclusions>
2) Within Jenkinsfile 2)在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). 3)关于声纳管自定义(分析范围)。
EDIT: This "non-exclusion" was originally leading to a memory dump that I could solved by extending the memory on sonarqube (sonar.properties). 编辑:此“非排除”最初导致内存转储,我可以通过扩展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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.