Sonar

win10 下 搭建jenkins + SonarQube + maven实现项目自动化部署

筅森魡賤 提交于 2019-12-05 23:32:21
Jenkins :基于Java开发的持续集成工具(既然是工具,肯定是用来减轻工作量的),可以监控持续重复的工作,如果这些重复的工作交给jenkins去做,这样不仅减轻了自己的工作量也实现了jenkins自身的价值 大笑.gif。就拿我之前在公司实习所做的项目来说:项目环境是Eclipse + Maven + SVN,项目发包部署通常是以下几个步骤:   1、Eclipse中首先Clean一下项目,然后使用maven install操作等待打包完成。   2、找到打好的jar包上传到windows服务器上。   3、远程登录服务器进入jar包保存路径,执行 java -jar jar包名称.jar 启动jar包。 每次项目部署发包(正式和测试)都要执行这样的步骤,如果没有接触更简便的操作也就这样随遇而安了,后来我遇到了Jenkins和SonarQube...... SonarQube :管理代码质量的开放平台,可以快速定位代码中潜在的或者明显的错误,说白了就是用于分析代码。 好了,扯了这么多回归正题: 资源下载:    资源文件 提取码:8yfc 一、jenkins安装有两种方式:   1、直接安装msi文件。   2、将war包放入tomcat的webapps文件夹下,执行tomcat。注意:webapps文件夹下不要有其它war包。   安装完成之后地址栏输入:

无套路,3分钟带你轻松上手SonarQube - 代码质量检测平台

断了今生、忘了曾经 提交于 2019-12-05 03:47:58
前言 想成为一名优秀的工程师,代码质量一定要过关! 开始搭建 SonarQube 1、获取 postgresql 的镜像 $ docker pull postgres 2、启动 postgresql $ docker run --name db -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -d postgres 3、获取 sonarqube 的镜像 $ docker pull sonarqube 4、启动 sonarqube $ docker run --name sq --link db -e SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar -p 9000:9000 -d sonarqube 至此,平台搭建完毕。 代码质量检验 1、打开 http://localhost:9000/ , 点击 "Log in" sonar平台 登录账号:admin 密码:admin 2、以 Maven 项目为例,此处有一个 security-oauth2-qq 项目: Maven 项目 pom.xml 添加配置: <!-- 代码质量检测 --> <profiles> <profile> <id>sonar</id> <activation> <activeByDefault>true<

sonar 在异常关机后无法启动

旧街凉风 提交于 2019-12-05 03:11:50
启动sonar的时候一直启动不了,报错如下: WrapperSimpleApp: Encountered an error running main: java.nio.file.AccessDeniedException: /usr/local/sonarqube/temp/conf/es/jvm.options java.nio.file.AccessDeniedException: /usr/local/sonarqube/temp/conf/es/jvm.options at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244) at sun.nio.fs.AbstractFileSystemProvider.delete

docker 安装 sonar

笑着哭i 提交于 2019-12-04 10:32:49
docker run --name db -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -d postgres docker run --name sq --link db -e SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar -p 9000:9000 -d sonarqube 打开 http://localhost:9000/ , 点击 "Log in" 登录账号:admin 密码:admin 新建项目 单元测试代码覆盖 <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.5</version> <executions> <execution> <goals> <goal>prepare-agent</goal> <goal>report</goal> </goals> </execution> </executions> </plugin> 来源: https://my.oschina.net/8808/blog/3129472

Jenkins+Gradle+android+SonarQube

允我心安 提交于 2019-12-03 21:01:04
一、环境 1. ubuntu14.04(64位) 2. jdk 1.7 3. ant 1.9 4. jenkins 1.606 5. tomcat 7.0.5 6. android sdk 7. gradle 8. nexus 9. sonarqube 二、安装 1. JDK环境变量 vim ~/.bashrc export JAVA_HOME=/usr/local/lib/jvm/jdk1.7.0_60 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH 2. gradle环境变量 http://gradle.org/下载最新的包 vim ~/.bashrc export GRADLE_HOME=/usr/local/lib/gradle2.2 export PATH=$GRADLE_HOME/bin:$PATH 3. Jenkins环境变量 http://jenkins-ci.org/下载稳定版本 vim ~/.bashrc export JENKINS_HOME=/home/roy/jenkins_home export PATH=$JENKINS_HOME:$PATH

Sonar Gerrit plugin not reporting results

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We utilize the pipeline and after the build completes successfully we are running the following: bat "mvn sonar:sonar -B -s ${buildSettings} -Dsonar.analysis.mode=preview -Dsonar.skipDesign=true -Dsonar.report.export.path=sonar-report.json" sonarToGerrit(severity: 'Major', postScore: true, category: 'Code-Review', newIssuesOnly: true, issuesScore: '0', noIssuesScore: '0', changedLinesOnly: true) The below build log shows that it found a good number of issues but yet the issues to be commented is 0. Build log Other posts suggest that it may

pitest doesn&#039;t find tests

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am facing a problem with the SonarQube project. I want to calculate some statistics about test quality and I am using pitest. Unfortunately, it doesn't find any test to mutate. This is the pom.xml of the module that I am analyzing: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.sonarsource

sonar findbugs heap size

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am new to sonar. i am running sonar from Jenkins with sonar pulgin. When i am running from jenkins i am getting out of memory exception at findbugs below is the error: Out of memory Total memory: 1037M free memory: 30M Analyzed: D:\Victor\autocreated\webapp\WEB-INF\classes Aux: C:\DOCUME~1\NADBHA~1\LOCALS~1\Temp\findbugs4165854405681394173.jar Aux: C:\DOCUME~1\NADBHA~1\LOCALS~1\Temp\findbugs4688505485649811865.jar Total time: 2:04:49.155s Final Memory: 358M/989M Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException:

SonarQube warning on MSBuild version

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Sonar 5.3 server, and in Jenkins I am at SonarQube Runner 2.2.1 . I recently upgraded sonar server from 4.5.2 to 5.3 but did not touch anything in Jenkins . Now when I am Invoking SonarQube standalone analysis, then I am getting the things done, but I am getting warning WARN - * Use MSBuild 14 to get the best analysis results * WARN - * The use of MSBuild 12 or the sonar-runner to analyze C# projects is DEPRECATED * I just wanted to know what I should upgrade here? I installed MSBuild 14.0 on the machine where Sonar Analysis is

Please update sonar-maven-plugin to at least version 2.3

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm building a project in Jenkins with Sonar Integration. Everything goes smoothly until the sonar analysis part. I get the following error: [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (default-cli) on project project-whatever: Can not execute SonarQube analysis: Please update sonar-maven-plugin to at least version 2.3 -> [Help 1] and then the build fails. I must explain that I have no references to sonar in my project pom.xml. This has been done exclusively with Jenkins configuration. Does anyone have any