Sonarsonarqube runner 2.44 和哪个jdk匹配

出处:http://blog.csdn.net
在最新的《 》中再次提到了代码分析: 6、尽量使用静态代码分析工具以提高审查效率。 笔者之前也谈到过多次代码分析、代码检查,见:
最近在自己电脑上更新了SonarQube,来分享下具体做法。 本文先来介绍最简单的做法:利用Jenkins拉取代码不编译只扫描。 1,首先下载最新的SonarQube,参见
当前最新版是4.4 下载后解压,先不着急启动。不知道为什么,SonarQube4.4没有包括SonarQube最新推荐的规则引擎。 2,在相同下载页,下载SonarQube Runner V2.4,解压。采用全部缺省配置,不必修改。 3,下载SonarQube最新推荐的Java分析引擎,参见http://docs.codehaus.org/display/SONAR/Java+Plugin 。
下载最新的
V2.4, 然后将其放到
\sonarqube-4.4\extensions\plugins 下, 其中\sonarqube-4.4是SonarQube的安装目录,然后移除相同目录下的 Surefire, JaCoCo, and Squid for Java plugins 以及 findbugs,即是只留下
V2.4,其它都移除。 4,为快速试用,利用SonarQube缺省数据库,到bin目录下选择合适环境目录来启动SonarQube。 5,利用Jenkins的windows batch command来启动sonar,所以对Jenkins版本没有特别要求,当然使用最新版Jenkins是最好的。笔者的Jenkins是V1.556。 6,在Jenkins中创建Job,选择“构建一个自由风格的软件项目” 7,在源码管理中加入源码的位置,笔者使用的是SVN,选择Subersion,输入Repository URL 8,在构建触发器中,笔者选择了Build periodically,输入H H * * *, 意味着每天在Jenkins空闲的时候执行一次 9,在构建部分,选择增加构建步骤,选择Execute Windows batch command, 在命令框中输入
SonarQube Runner V2.4安装位置\bin\sonar-runner.bat 10,配置项目,在要分析的源代码根目录(与Repository URL要对应一致)下新建名为 sonar-project.properties 的文件,至少包括如下:
# required metadata ,Keqiang:AgileJerryPomodoro是笔者项目的Key
sonar.projectKey=Keqiang:AgileJerryPomodoro
#AgileJerryPomodoro是笔者项目的名称
sonar.projectName=AgileJerryPomodoro
sonar.projectVersion=0.5.0
# path to source directories (required),从源代码根目录为基准
sonar.sources=src
11,将sonar-project.properties 加入到SVN。 12,到Jenkins中立即构建 刚刚建立的Job 13,访问
来看看SonarQube的结果 说明1:以上利用了SonarQube的缺省规则集:Sonar way,共115条规则,这是sonarqube多年来积累的精华规则。 SonarQube当前已经明确宣称:“ We highly recommend that you limit your
to from the SonarQube engine
because we believe they are faster, more accurate (fewer false positives and false negatives), and more usable
(they have better descriptions, etc).&
说明2: Squid, Surefire and Jacoco have been rolled into this Java plugin. from Java plugin V2.4
以上动作最多1小时就能完成,对于Java,就能得到业界最先进的代码检查结果。 通过结果再来学习干净代码,是事半功倍的做法。
作者:zhangmike 发表于 8:52:39
阅读:99 评论:0
相关 [sonarqube4.4 jenkins 代码] 推荐:
- CSDN博客推荐文章
SonarQube4.4+Jenkins进行代码检查实例之一》 中介绍了不编译只检查的方式. 但是有些代码检查需要使用字节码,比如Findbugs的检查依赖于字节码,实例一中只提取源代码,就不能进行Findbugs的检查. 要进行Findbugs检查就需要编译. 1,首先当然是要下载最新的Findbugs
http://docs.codehaus.org/display/SONAR/FindBugs+Plugin
,当前最新版是V3.0,
supports analysis of Java 8 bytecode but requires Java 1.7 to run (see Compatibility section).
- CSDN博客研发管理推荐文章
在最新的《 关于代码审查的几点建议》中再次提到了代码分析: 6、尽量使用静态代码分析工具以提高审查效率. 笔者之前也谈到过多次代码分析、代码检查,见:. 关于代码评审的微博讨论汇集 . #敏捷有效实践# 每日代码自动检查 英文是daily code inspection. 对代码质量关注时,安排人工检查code review是需要的,但100% code review需要很多工作量,不是所有的组织值得这样做,而工具自动检查是只需少量人工建设配置,99%的组织值得采用.
- CSDN博客研发管理推荐文章
Jenkins强大的功能主要靠其丰富的plugin体现,之前的一篇博客《
Jenkins安装plugin》中介绍了如何找到并安装需要的plugin. 虽然目前已经有大量非常优秀的plugin可供使用,但是有时候仍需要自己开发一些满足项目特殊要求的plugin. 下面通过一个简单实例,介绍Jenkins的plugin的整个开发过程.
- 研发管理 - ITeye博客
在Java软件开发过程中,开发团队往往要花费大量的时间和精力发现并修改代码缺陷. Java 静态代码分析(static code analysis)工具能够在代码构建过程中帮助开发人员快速、有效的定位代码缺陷并及时纠正这些问题,从而极大地提高软件可靠性并节省软件开发和测试成 本. 目前市场上的 Java 静态代码分析工具种类繁多且各有千秋,因此本文将分别介绍现有 4 种主流 Java 静态代码分析工具 (Checkstyle,FindBugs,PMD,Jtest),并从功能、特性等方面对它们进行分析和比较,希望能够帮助 Java 软件开发人员了解静态代码分析工具,并选择合适的工具应用到软件开发中.
- CSDN博客研发管理推荐文章
首先从官网
http://jenkins-ci.org/下载 Java Web Archive (.war). 例如我保存到 D:\jenkins\jenkins.war. 运行Jenkins需要JRE的支持Java5 or later. 默认会运行在8080端口,正常启动完成如下图. 我们可以在浏览器输入127.0.0.1:8080来查看,如图我们的Jenkins已经跑起来了.
- ITeye博客
Jenkins是一个持续集成工具,前身叫做Hudson,在实际项目应用中非常重要,本文介绍这一工具的使用方法. 首先我们访问Jenkins的网站:. Jenkins 的网址是: http://jenkins-ci.org/. 从网站下载Jenkins:
http://mirrors.jenkins-ci.org/war/latest/jenkins.war.
- 研发管理 - ITeye博客
Jenkins是帮我们将代码进行统一的编译打包、还可以放到tomcat容器中进行发布. 意思是我们通过配置,将以前:编译、打包、上传、部署到Tomcat中的过程交由Jenkins,Jenkins通过给定的代码地址URL,将代码拉取到其“宿主服务器”(这是我个人的称呼,在下边会用到,就是Jenkins的安装位置),进行编译、打包和发布到容器中.
- Fstone - INET6
這是上週在Coscup 2011活動中演講的主題與投影片. Jenkins (http://jenkins-ci.org/) 是個廣為使用的持續集成(Continue Integration)框架,可以協助軟體工程師統合處理各種圍繞著「寫程式」之外的程式開發工作(如版本控制、環境設定、編譯、測試、發佈).
- InfoQ cn
由于与云软件提供商CloudBees的合作关系,现在Google App Engine用户可以使用持续集成工具Jenkins来构建、测试与部署其云应用了. 该新服务(通过托管的CloudBees. DEV@Cloud产品来提供)延续了PaaS的趋势——提供了持续集成工具,可以连接到主流的源码控制仓库上.
- 赖勇浩的编程私伙局
jenkins 集成 redmine 账户验证的方案. 赖勇浩(
). Jenkins 是最著名的持续集成工具,又因为它开源免费、插件众多,成为了许多团队做持续集成的首选. Jenkins 本身支持多种账户验证方案,但最棒的是它支持验证插件,可以把账户验证的工作完全托管给插件,这就为它支持更多的账户验证方案提供了无限可能.
坚持分享优质有趣的原创文章,并保留作者信息和版权声明,任何问题请联系:@。sonarqube - sonar-runner.bat Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher .java:91) - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 7.1 million programmers, just like you, helping each other.
J it only takes a minute:
I got the latest
sonar-runner-dist-2.4 and sonarqube-4.3. Server starts fine, i can see the localhost But when i try to run the sonar-runner.bat -X, i see the below error. I looked at versions, logs but couldn't find the root-cause. Any help will be appreciated.
enter code here
MyProject&sonar-runner.bat -X
C:\sonar\sonar-runner-dist-2.4
SonarQube Runner 2.4
Java 1.6.0 IBM Corporation (32-bit)
Windows Vista 6.1 build 7601 Service Pack 1 x86
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\sonar\sonar-runner-dist-2.4\conf\sonar-runne
r.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is
platform dependent)
INFO: Work directory: C:\cww\application\CWW_FSET_R0\online\aeEJB\.\.sonar
INFO: SonarQube Server 4.3
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.191s
Final Memory: 2M/5M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(AccessController.java:202
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.TypeNotPresentException: Type javax.annotation.CheckForNull
not present
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.j
at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(Annotatio
nHelper.java:50)
at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:31)
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:687)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.ja
at com.ibm.oti.reflect.Method.getAnnotation(Method.java:20)
at java.lang.reflect.Method.getAnnotation(Method.java:677)
at org.picocontainer.injectors.AdaptingInjection.injectionAnnotated(Adap
tingInjection.java:230)
at org.picocontainer.injectors.AdaptingInjection.access$000(AdaptingInje
ction.java:46)
at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection
.java:203)
at java.security.AccessController.doPrivileged(AccessController.java:202
at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotate
d(AdaptingInjection.java:200)
at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectio
nAdapter(AdaptingInjection.java:171)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(
AdaptingInjection.java:70)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAd
apter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptIn
Caching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContai
ner.java:535)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContaine
r.java:83)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addC
omponent(DefaultPicoContainer.java:1148)
at org.sonar.ponentContainer.addComponent(ComponentConta
iner.java:175)
at org.sonar.ponentContainer.addSingleton(ComponentConta
iner.java:163)
at org.sonar.ponentContainer.add(ComponentContainer.java
at org.sonar.batch.bootstrap.BootstrapContainer.addBootstrapComponents(B
ootstrapContainer.java:83)
at org.sonar.batch.bootstrap.BootstrapContainer.doBeforeStart(BootstrapC
ontainer.java:77)
at org.sonar.ponentContainer.startComponents(ComponentCo
ntainer.java:90)
at org.sonar.ponentContainer.execute(ComponentContainer.
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher
... 9 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.CheckForNull
at java.lang.Class.forName(Class.java:169)
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.j
... 42 more
Here is my property file :
# required metadata
sonar.projectKey=my:MyProject
sonar.projectName=MyProject
sonar.projectVersion=1.0
# optional description
sonar.projectDescription=Any description
# path to source directories (required)
sonar.sources=src
# path to test source directories (optional)
#sonar.tests=testDir1,testDir2
# path to project binaries (optional), for example directory of Java bytecode
sonar.binaries=bin
# The value of the property must be the key of the language.
sonar.language=java
# Additional parameters
sonar.my.property=value
This issue seems to relate to the use of the IBM Java Virtual Machine : . By using the Oracle one this should fix your issue.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25842
Stack Overflow works best with JavaScript enabled您所在位置: &
&nbsp&&nbsp&nbsp&&nbsp
sonar-runner方式使末用说明.doc 8页
本文档一共被下载:
次 ,您可全文免费在线阅读后下载本文档。
下载提示
1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。
2.该文档所得收入(下载+内容+预览三)归上传者、原创者。
3.登录后可充值,立即自动返金币,充值渠道很便利
需要金币:150 &&
你可能关注的文档:
··········
··········
一、sonar环境搭建1、安装JDK-1.5以上版本。在环境变量中配置JAVA_HOME,并在path里添加%JAVA_HOME%\2、安装mysql-5.x以上版本。3、mysql新建数据库并增加权限CREATEDATABASEsonarCHARACTERSETutf8COLLATEutf8_general_; FLUSHPRIVILEGES;sonar-2.8.zip,不要放在中文目录下。5、配置sonar-2.8\conf\sonar.properties文件。1)配置启动的http端口sonar.web.host:sonar.web.port:9000sonar.web.context:/三句前本来被注释,取消注释2)取消mysql连接的注释#-----MySQL5.x/6.x#CommenttheembeddeddatabaseanduncommentthefollowingpropertiestouseMySQL.Thevalidationqueryisoptional.sonar.jdbc.url:jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8sonar.jdbc.driverClassName:com.mysql.jdbc.Driversonar.jdbc.validationQuery:select1运行sonar-2.8\bin\windows-x86-32\StartSonar.bat,打开相应的网页:http://localhost:9000测试是否配置成功,这里的页面链接跟前头的http配置有关二、配置sonar-runner1、下载并解压sonar-runner.zip官网下载网址:http://repository.codehaus.org/org/codehaus/sonar-plugins/sonar-runner/1.0/sonar-runner-1.0.zip2、环境变量,设置SONAR_RUNNER_HOME,在Path下添${SONAR_RUNNER_HOME}/bin(Unix)or%SONAR_RUNNER_HOME%/bin。3、修改${SONAR_RUNNER_HOME}/conf/sonar-runner.properties文件,打开databaseconnection,serverURL的注释命令行中输入sonar-runner–h查看是否配置成功三、测试文件的配置1、在每个项目的项目源文件目录下新建一个文件名为sonar-project.properties的文件,在文件中输入以下内容:#requiredmetadata#Myproject------修改成你的项目名称sonar.projectKey=my:projectsonar.projectName=Myprojectsonar.projectVersion=1.0#pathtosourcedirectories(required)#srcDir1,srcDir2---------修改成你的源文件夹路径sources=srcDir1,srcDir2#pathtotestsourcedirectories(optional)#testDir1,testDir2--------修改成你的测试文件夹路径tests=testDir1,testDir2#pathtoprojectbinaries(optional),forexampledirectoryofJava#bytecode#binDir--------修改成你的二进制文件夹路径binaries=binDir#pathtoprojectlibraries(optional)libraries=junit.jar#advancedparametersmy.property=value四、应用sonar监测代码质量以上配置完成之后,就可以应用sonar来监测代码质量了。1、先启动sonar用sonar-2.8\bin\windows-x86-32\StartSonar.bat文件,这时可以查看sonar-2.8\logs\sonar.log文件,看是否已经启动sonar2、启动好sonar之后,接着在命令行中切换到项目文件的目录下,然后输入sonar-runner,等到运行结束后,进入到http://localhost:9000页面,查看代码的质量统计结果。五、错误:java.lang.OutOfMemoryError处理方法:在sonar-ru
正在加载中,请稍后...当前位置: >
SonarQube(5.0.1) 环境的安装配置
时间: 22:40
SonarQube 安装步骤
确定 JDK 和 MySQL 已经成功安装。
下载 SonarQube 及工具 SonarQube Runner,下载地址:http://www.sonarqube.org/downloads/
解压文件,将下载的SonarQube 和SonarQube Runner 解压到指定的目录。
添加环境变量:
export SONAR_HOME=/home/huey/huey/sonar/sonarqube-5.0.1
export SONAR_RUNNER_HOME=/home/huey/huey/sonar/sonar-runner-2.4
export PATH=${SONAR_RUNNER_HOME}/bin:$PATH
数据库(MySQL)的配置:
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
在创建数据库与用户后, 修改sonar.properties 属性文件:
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=truecharacterEncoding=utf8rewriteBatchedStatements=trueuseConfigs=maxPerformance
sonar.jdbc.driverClassName=com.mysql.jdbc.Driver
根据数据库配置在 SonarQube Runner 的属性文件 sonar-runner.properties 取消对应的注释:
#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
#----- PostgreSQL
sonar.jdbc.url=jdbc:postgresql://localhost/sonar
#----- MySQL
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=truecharacterEncoding=utf8
#----- Oracle
#sonar.jdbc.url=jdbc:oracle:thin:@localhost/XE
#----- Microsoft SQLServer
#sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/SelectMethod=Cursor
#----- Global database settings
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
#----- Default source code encoding
#sonar.sourceEncoding=UTF-8
#----- Security (when 'sonar.forceAuthentication' is set to 'true')
sonar.login=admin
sonar.password=admin
下一篇:没有了

我要回帖

更多关于 sonar runner 下载 的文章

 

随机推荐