Sonar

How to configure a Jenkins Pipeline for SonarQube scan

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to configure a jenkins pipeline for my project, but there is something missing here, if anyone could direct on what I am doing wrong: Below is the pipeline script: node { stage('SonarQube analysis') { // requires SonarQube Scanner 2.8+ def scannerHome = tool 'sonarScanner'; withSonarQubeEnv('SonarQube 6.2') { bat "${scannerHome}/bin/sonar-runner.bat" } } } Below is the Jenkins Sonar Plugin related configurations: Under Manage Jenkins > Configure System : Under Manage Jenkins > Global Tool Configuration Below is the error that I

Jacoco and Sonar code coverage?

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using : JaCoCo 0.5.3, Maven2, Sonar 2.14, sonar-maven-plugin 1.8, SùartGWT 3.0 Currently trying to : Get code coverage on Sonar of my Selenium unit tests. Problem : Code coverage doesn't move from 0% although the sensor is launched properly, analyse the jacoco.exec which is correctly generated. Ressources : https://gist.github.com/2888912 The pom.xml It's been about 2 weeks I'm trying to get code coverage. I upgraded the Sonar from 2.10 to 2.14, changed every single sonar property, tried the plugin jacoco (for maven) and I still DON'T get

SonarQube 5.1.1 Read Timed out Error occurs while loading project repositories

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: While using the sonar runner to analyze the multi module project I frequently get the “Read Timed Out” error. I have Jenkins configured with SonarQube 5.1.1. Our project is kind of web project, we have a couple of sonar plugins for the analysis like web, css, java, findbugs, js, xml and jacoco. If I load the given link " http://172.21.145.84:9000/batch/project?key=webportal&preview=false " from browser it works, but sometimes it takes quite long to load the response data. Can anyone please give me any suggestion regarding this

Error with sonar run

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ps04 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ ps04 --- [WARNING] Error injecting: org.sonarsource.scanner.maven.SonarQubeMojo java.lang.NoClassDefFoundError: org/sonarsource/scanner/api/LogOutput at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class

Make this line start at column 9 sonar violation fix(Source code should be indented consistently)

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am fixing all the sonar violation fix and I have nearly 6k issue like Make this line start at column 9" issues. I tried adding the java formatter, but it did not resolve the issue instead increase my sonar violation to 9k. Can you please let me know which java formatter to use so it will complaint. <plugin> <groupId>net.revelc.code</groupId> <artifactId>formatter-maven-plugin</artifactId> <version>0.5.2</version> <executions> <execution> <goals> <goal>format</goal> </goals> </execution> </executions> </plugin> or <!--Plugin for formatting

Sonarqube quality gate not sending webhook to jenkins

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I configure Jenkins to work with sonarqube scanner. The scan are working fine. The jenkins pipeline is working and I don't have any isssue in the jenkins log. SonarQube Scanner 3.0.3.778 Jenkins: 2.70 SonarQube Scanner for Jenkins plugin: 2.6.1 I use this code: stage('SonarQube analysis') { sh 'sed -ie "s|_PROJECT_|${PROJECT_CODE}|g" $WORKSPACE/_pipeline/sonar-project.properties' // requires SonarQube Scanner 3.0+ def scannerHome = '/opt/sonar/bin/sonar-scanner'; withSonarQubeEnv('mscodeanalysis') { sh "${scannerHome}/bin/sonar-scanner

correctly setting sonar.sources in jenkins plugin

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build an Android java project branch: feature-Fprototype_app I am getting this error: [INFO] [13:38:36.470] Base dir: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile [INFO] [13:38:36.470] Working dir: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/target/sonar [INFO] [13:38:36.470] Source dirs: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/src [INFO] [13:38:36.470] Binary dirs: /Users/Shared/Jenkins/Home/jobs/Textify/workspace/mobile/target/classes [INFO] [13:38:36.470] Source encoding: UTF-8,

Sonar false-positive on rule: Null pointers should not be dereferenced

匿名 (未验证) 提交于 2019-12-03 08:51:18
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a sonar alert on this call minRating.getRatgCaam() The alert is related to the sonar rule : Null pointers should not be dereferenced. Ex: AgencyRating minRating = null; ....... if (!getRatingUtilities().isNR(minRating)) { return minRating.getRatgCaam(); //Sonar: Null pointers should not be dereferenced } The method isNR(minRating) is a helper method that validate among other things, if the object minRating is null public boolean isNR(AgencyRating rating) { return rating == null || isNR(rating.getRatgCaam()); } When I added the not

Jenkins sonar check failure: Caused by: java.lang.ClassNotFoundException: org.sonar.api.checks.NoSonarFilter

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I call Jenkins build job, It throw following error and job failed.* Can anyone have saw this error? Jenkins version: 1.642.1 Sonar version: 5.4 (Java plugin 3.5) Here is the error info: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project ods-replicator: Unable to register extension org.sonar.plugins.java.JavaSquidSensor: Lorg/sonar/api/checks/NoSonarFilter;: org.sonar.api.checks.NoSonarFilter -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to

Integrate Spock&#039;s test with Sonar

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use spock to write test case and jenkins to run and publish my test cases. I was able to get the code coverage reported but sonar shows me only Java Unit test cases; the groovy test cases are totally missing The following pom.xml is used as reference https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/pom.xml would anyone please know what I am missing ? 回答1: Install the Groovy plugin in Sonar. Login as admin/admin and go to the administration/system/update-center tab Add the following property