sonarqube

Running code coverage with Cobertura and Jacoco

≡放荡痞女 提交于 2020-01-01 06:26:05
问题 I have a bit of a problem getting code coverage reports for both Integration Tests and Unit Tests in Sonar for a Maven Plugin project (which uses invoker plugin for the integration tests). I can't use the default Jacoco coverage tool for the unit tests, as these use Powermock, which results in 0% coverage for classes using that. On the other hand, I can't find a reliable way to get results for the Groovy-based integration tests without using Jacoco. So what I need is for Cobertura to produce

SonarQube upgrade from 6.4 to 6.5 breaks the scanner

不打扰是莪最后的温柔 提交于 2020-01-01 04:50:22
问题 I am on sonarQube6.4 and have upgraded to 6.5 Sonar-scanner is 3.0.3 Now after the upgrade the scanner fails anytime there is a java file in the source path. If I don't scan java files everything works just fine. However If I rollback an use 6.4 version, everything works fine, so is there any regression? This is the stack trace, when I run the scanner command with -X command. So is it a mandate in 6.5 to provided the location of all compiled classed, is there a way to ignore it. 04:56:21.218

Can't import PMD Ruleset in Eclipse

若如初见. 提交于 2020-01-01 04:26:29
问题 I would like to use the same Ruleset in my IDE (Eclipse) that my Sonar profile. I got the PMD XML ruleset from the Sonar Permalinks and would like to import it into my PMD Eclipse Plugin but when i try to do it, the "OK" button is desactivated ... Can someone help me ? 回答1: The problem could be that Sonar is exporting your ruleset for v4.x format and your Eclipse plugin expects them in v5.x format. Try changing your rules from: <rule ref="rulesets/basic.xml/UnusedNullCheckInEquals"> <priority

start SonarQube server with specific jdk

故事扮演 提交于 2020-01-01 02:31:10
问题 Is there a way to start the SonarQube server (v. 3.7.4) with an specific jdk? My case: My java-home is set to jdk 1.8, but SonarQube server has some known problems with 1.8. So I want to start the server with jdk 1.7 (without setting my java-home to 1.7). I couldn't find anything in the bat-files. OS: Windows 7; SonarQube server version: 3.7.4 回答1: You have to edit the <install_directory>/conf/wrapper.conf file and update the wrapper.java.command property to point to the JDK you want.

How to react on SonarQube Quality Gate within Jenkins Pipeline

一世执手 提交于 2019-12-31 22:39:08
问题 Within my Jenkins Pipeline I need to react on the SonarQube Quality Gate. Is there an easier way to achieve this but looking in the Sonar-Scanner log for the result page (e.g. https://mysonarserver/sonar/api/ce/task?id=xxxx) and parse the JSON Result from there? I use Jenkins 2.30 and SonarQube 5.3 Thanks in advance 回答1: Based on Vincent's answer, and using Pipeline utility steps, here's my updated version that worked for me (using sonarscanner report file) : withSonarQubeEnv('SONAR 6.4') {

SonarQube MSBuild fails to exclude files

这一生的挚爱 提交于 2019-12-31 04:43:09
问题 I am running an analysis using msbuild on debian, using the following command: mono /msbuild/SonarQube.Scanner.MSBuild.exe begin /d:sonar.login=<sonarqubetoken> /d:sonar.host.url=https://<my-server> /d:sonar.exclusions=test/**/* /k:<my-project-key> However in the end command: INFO: Index files INFO: Excluded sources: INFO: test/**/* INFO: 17 files indexed INFO: 0 files ignored because of inclusion/exclusion patterns INFO: Quality profile for cs: Sonar way INFO: Excluded sources for coverage:

SonarQube Temp Disk Space

北城以北 提交于 2019-12-31 04:34:25
问题 I'm finding SonarQube is using a lot of disk space in it's temp directory. Is there some sort of clean-up routine that runs regularly to purge this? --- /opt/codehaus/releases`/sonarqube/sonarqube-5.1/temp ------------------------------------------------------------------------------------------- /.. 29.7GiB [######### ] /tmp 92.0KiB [ ] jffi6092968669040435416.tmp 60.0KiB [ ] liblz4-java2192651176366163015.so 20.0KiB [ ] /tc e 4.0KiB [ ] /ror 4.0KiB [ ] sharedmemory If not, does anyone have

Gradle sonarqube not recognizing groovy tests

倾然丶 夕夏残阳落幕 提交于 2019-12-31 01:43:13
问题 I have a multi-language project with tests implemented using Java (JUnit) and Groovy (Spock). plugins { id "org.sonarqube" version "2.2.1" } apply plugin: 'idea' apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'jacoco' ext { spockVersion = '1.1-groovy-2.4-rc-3' groovyVersion = '2.4.7' } group = "at.softwarecraftsmen.poc" version = "1.0.0-SNAPSHOT" repositories { mavenCentral() } dependencies { testCompile "junit:junit-dep:4.11" testCompile "org.codehaus.groovy:groovy-all:

Sonar fails to connect to mySQL always tries jdbc:h2:tcp://localhost/sonar

Deadly 提交于 2019-12-31 01:14:41
问题 This morning I have downloaded Sonar latest version. maven 3.2.5, mysql. Sonar setup went correctly and I have the web site at 9000 working fine and all tables correctly created in mySql. I have updated my .m2/settings.xml with the following <profiles> <profile> <id>sonar</id> <properties> <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true</sonar.jdbc.url> <sonar.jdbc.username>myuser</sonar.jdbc.username> <sonar.jdbc.password

Sonar在Windows下的安装配置

可紊 提交于 2019-12-30 18:07:18
https://blog.csdn.net/huo108/article/details/81160624 1、下载完SonarQube后解压,进入解压路径到bin目录下,启动StartSonar.bat文件。 2、在浏览器上输入: http://localhost:9000 查看是否启动成功 3、配置数据库:新建一个名为sonar的数据库(已经安装了postgresql数据库)。 4、打开sonarqube解压路径下的conf目录打开sonar.properties配置文件,添加数据库连接信息配置: sonar.jdbc.url=jdbc:postgresql://192.168.201.55:5432/sonar sonar.jdbc.username=postgres sonar.jdbc.password=123456 sonar.sorceEncoding=UTF-8 sonar.login=admin sonar.password=admin 5、编辑 wrapper.conf文件 修改java.command地址 wrapper.java.command=java 如果已经配置了Java系统环境变量,这里就可以直接写java,不用做更改。 在Maven的conf/ssettings.xml设置sonar信息 其中<sonar.host.url>http:/