Hudson-Tomcat-Ant -SVN 配置

一、下载、部署

1:下载Tomcat 、 Ant 、hudson-2.2.1.war

2:将hudson部署到tomcat

二、配置

1:配置Hudson的JDK

    系统管理-->系统设置-->JDK

2:下载Tomcat自动部署插件

    系统管理-->插件管理-->可选插件-->搜索"Tomcat"关键字,选择”Hudson Deploy Plugin“,点击右下角”安装“。

3:新建任务

4:配置任务相关参数

  4.1:代码本地暂存目录

Advanced Project Options-->Use custom workspace;输入文件路径

  4.2:代码管理软件配置

Source Code Management-->Subversion

Repository URL:

  4.3:构建频率

Build Triggers-->Poll SCM;格式:*/15 * * * *

  4.4:构建命令

Build-->Execute Windows Batch Command

例子:cd xxxxWarName

 ant war -Dtomcat.home=E:\yangf\app\apache-tomcat-7.0.33

说明:-Dtomcat.home,表示,用这里的值替换build.xml中定义的值

  4.5:部署Tomcat

Post-build Actions-->Deploy war/ear to a container

WAR/EAR files:ssi\build\ssi.war

Container:Tomcat 7

Manager user name:tomcat

Manager password:tomcat

Tomcat URL:http://localhost:8080/

补充说明:

1:配置Tomcat的用户权限

tomcat-users.xml:

<role rolename="admin"/>  
  <role rolename="manager"/>
  <role rolename="tomcat"/>
  <role rolename="manager-gui"/><!-- allows access to the HTML GUI and the status pages -->
  <role rolename="manager-script"/><!-- allows access to the text interface and the status pages -->
  <role rolename="manager-jmx"/><!-- allows access to the JMX proxy and the status pages -->
  <role rolename="manager-status"/><!-- allows access to the status pages only -->
  <user username="tomcat" password="tomcat" roles="tomcat,manager-gui,manager-script,manager-jmx,admin,manager"/>
 

2:批处理脚本里用的是ant进行编译,所以,需要提前配置好ant_home

猜你喜欢

转载自yhef.iteye.com/blog/1752569