hudson安装与配置

2 篇文章 0 订阅
1 篇文章 0 订阅
Hudson下载与安装:
1)下载地址:http://java.net/projects/hudson/downloads/download/war/hudson-2.1.0.war
2)将文件放到tomcat的webapps中,并启动tomcat
3)打开浏览器,确认可以进行访问

Hudson插件安装
1) Checkstyle Plug-in
2) FindBugs Plug-in
3) PMD Plug-in
4) Hudson Cobertura plugin
安装完成后,重新启动hudson

Hudson系统配置
配置一些jdk,ant,maven等信息,此处略。

创建项目
1) 选择maven项目
2) 输入svn的Repository URL。
3) 在Build的配置中,root POM是默认的,不需要进行修改。
Goals and options中输入compile findbugs:findbugs pmd:pmd cobertura:cobertura checkstyle:checkstyle。不要使用site的goals,那样会跳过checkstyle的report。
4) Build Settings中把pmd,findbugs,checkstyle勾选。
5) Post-build Actions中把Publish Cobertura Coverage Report勾选,在Cobertura xml report pattern中输入:**/target/site/cobertura/coverage.xml,其它选项随意。
到此为止,hudson配置项目的工作已经完成。

项目配置
下面是pom.xml文件,只保留了相关插件的配置,请参考:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jdkVersion>1.6</jdkVersion>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<aggregate>true</aggregate>
<linkXref>true</linkXref>
<targetJdk>${jdkVersion}</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>true</findbugsXmlOutput>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<check>
<branchRate>70</branchRate>
<lineRate>70</lineRate>
<haltOnFailure>true</haltOnFailure>
<totalBranchRate>70</totalBranchRate>
<totalLineRate>70</totalLineRate>
<packageLineRate>100</packageLineRate>
<packageBranchRate>100</packageBranchRate>
<regexes>
<regex>
<pattern>xxx.xxx.xxx.xxx.*</pattern>
<branchRate>60</branchRate>
<lineRate>70</lineRate>
</regex>
</regexes>
</check>
<instrumentation>
<ignores>
<ignore>xxx.xxx.xxx.*</ignore>
</ignores>
<excludes>
<exclude>xxx/xxx/xxx/*.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.7</version>
<configuration>
<configLocation>自己定义的checks xml 文件</configLocation>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>true</findbugsXmlOutput>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<aggregate>true</aggregate>
<linkXref>true</linkXref>
<targetJdk>${jdkVersion}</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
<pluginRepositories>
<pluginRepository>
<id>Codehaus repository</id>
<url>http://repository.codehaus.org/</url>
</pluginRepository>
</pluginRepositories>



这篇文章如果对您有帮助,请回复,如果没有帮助,也回复,哈哈哈,就是不管有没有帮助 ,都回复吧。本人不太愿意写东西,回复的少了,就更不愿意写了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值