Sonar

“Analysis collector” or “SONAR” for Jenkins?

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking at adding static code analysis to our Jenkins builds of a Java project (~500K lines of code). Two possibilities are Analysis Collector or SONAR . One advantage of SONAR looks to be it can show dead code and deprecated methods . Recommendations? 回答1: Sonar is not just a tool to integrate other tools in a unified environment. First with Sonar you can analyze not just Java source code but code developed in more than 20 languages. http://www.sonarsource.com/products/plugins/languages/ Then the star feature of Sonar is the

Using waitForQualityGate in a Jenkins declarative pipeline

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The following SonarQube (6.3) analysis stage in a declarative pipeline in Jenkins 2.50 is failing with this error in the console log: http://pastebin.com/t2ja23vC . More specifically: SonarQube installation defined in this job (SonarGate) does not match any configured installation. Number of installations that can be configured: 1. Update: after changing "SonarQube" to "SonarGate" in the Jenkins settings (under SonarQube servers, so it'll match the Jenkinsfile), I get a different error: http://pastebin.com/HZZ6fY6V java.lang

Sonar runner: JAVA_HOME exists but does not point to a valid Java home folder

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Situation : I installed Sonarqube on a Win XP 32-bit system. I set all paths as instructed. The server opens up well at localhost://9090. My JAVA_HOME is: C:\Program Files\Java\jdk1.7.0_60; Problem When I run, sonar-runner.bat, I get the following error: ERROR: Java_Home exists but does not point to a valid Java home folder. No "\bin\java.exe" file can be found here. What I tried: I added /bin to the path. I tried /jre, and then /jre/bin (Note: all of them contain the "/bin/java.exe" within them. Is this due to some permissions issue of the

Running code coverage with Cobertura and Jacoco

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 a Unit Test report, Jacoco to produce an

DEVOPS技术实践_11:Jenkins集成Sonar

瘦欲@ 提交于 2019-12-03 07:07:56
前言 前面已经有介绍sonar的安装,简单应用,下面在简答的研究一下sonar和jenkins集成的简单使用,对于sonar的安装不做介绍 一 sonar的简单介绍 持续检查避免了低质量的代码,比如SonarQube工具就能够帮助我们完成此项。每次代码提交后,在代码上就会执行代码分析。 分析是基于代码分析工具中定义的一些规则,如果代码通过了错误阀值,那么它会允许到生命周期的下一步,如果超过了设定的阀值,那么直接返回错误。 SonarQube是代码质量管理工具,允许团队去管理,追踪和改善他们的源代码质量,它是包含了规则,告警和阀值的一个基于WEB的应用。它包含了七种类型的代码质量参数,分别是加构和设计,重复,单元测试,复杂度,潜在bug,编码规则和评论。 SoanrQube是一个开源的工具,支持几乎所有的流行语言,并且能够和CI工具有效的集成执行持续检查。 目前已经有的工具 Jenkins:192.168.132.131 Gitlab:192.168.132.132 Sonar:192.168.132.133 Artifactory:192.168.132.134 二 配置sonar 2.1 生成token 生成一个token,这个token是sonar和Jenkins连接的钥匙 生成token token

sonar报错volatile

╄→гoц情女王★ 提交于 2019-12-03 05:30:17
问题发生 原先代码如下: //认证授权码 private static volatile String AUTHORIZATION_CODE = "init"; git push 之后,sonar认为这是个bug检测报告截图如下: 分析排查 解释说明: Marking an array volatile means that the array itself will always be read fresh and never thread cached, but the items in the array will not be. Similarly, marking a mutable object field volatile means the object reference is volatile but the object itself is not, and other threads may not see updates to the object state. This can be salvaged with arrays by using the relevant AtomicArray class, such as AtomicIntegerArray, instead. For mutable objects, the volatile

Jenkins Sonar plugin suddenly stops working

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Our Jenkins builds started failing overnight with the error: [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project <project>: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar failed: Unable to load the mojo 'sonar' in the plugin 'org.codehaus.mojo:sonar-maven-plugin:2.7' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/codehaus/mojo/sonar/SonarMojo : Unsupported major.minor version 51.0 The Jenkins

Sonar - OutOfMemoryError: Java heap space

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am deploying a large Java project on Sonar using "Findbugs" as profile and getting the error below: Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space What i have tried to resolve this: Replaced %SONAR_RUNNER_OPTS% with -Xms256m -Xmx1024m to increase the heap size in sonar-runner bat file. Put "sonar.findbugs.effort" parameter as "Min" in Sonar global parameters. But both of above methods didn't work for me. 回答1: I had the same problem and found a very different solution, perhaps because I'm

java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation : Unsupported major.minor version 52.0

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Environment details: SonarQube 5.6 Apache Maven 3.3.9 Java version: 1.7.0_09 I integrated SonarQube plugin with java maven project like in pom.xml <build> <pluginManagement> <plugins> <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>3.0.2</version> </plugin> </plugins> </pluginManagement> </build> While executing goal: mvn sonar:sonar -Dsonar.host.url=<url> Getting exception: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli)

JaCoCo - SonarQube - No information about coverage per test

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using JaCoCo for Code Coverage. The Unit Test reports are created with junit and they are imported correctly, so that the unit test information is shown properly. The problem is, that I get the error message: No information about coverage per test. and the code coverage is shows the value 0% for unit tests, integration tests and overall coverage. I checked all required information in the sonar-project.properties like binary, src, tests etc. I'm using: - SonarQube 4.5.1 - SonarRunner 2.4 - MySQL - junit 4.1.1 - jacoco 0.7.2 The jacoco