88

jenkins 自动从svn获取源码通过maven打包后发布到远端tomcat-梦想家Lee的技术博客-51C...

 6 years ago
source link: http://blog.51cto.com/13491150/2066767
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

jenkins 自动从svn获取源码通过maven打包后发布到远端tomcat

手动生成web的war源码文件。
mvn archetype:generate -DgroupId=com.companyname.automobile -DartifactId=trucks -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
将生成文件夹trucks

然后将truck文件夹的内容上传到svn上面,再用jenkins构建。

jenkins安装插件
Deploy to container Plugin
Maven Release Plug-in Plug-in
Subversion Plug-in
Maven Integration plugin

在192.168.56.20部署tomcat
vim tomcat-users.xml 设置权限
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="manager-script,manager-jmx,manager-status,manager-gui" />

在jenkins上配置项目
1、新建job源码管理用subversion,协商snv地址svn://192.168.56.100/sadoc以及用户名和密码
2、触发器选择定时poll SCM 内容:H/6
3、Build
Goals and options:clean install package -Dmaven.test.skip=true
4、构建设置Deploy war/ear to a container
WAR/EAR files:target/*.war
写入tomcat用户名和密码以及url

项目成功以后会就可以通过http://192.168.56.20:8080/trucks/ 访问部署的web了

©著作权归作者所有:来自51CTO博客作者超级梦想家的原创作品,如需转载,请注明出处,否则将追究法律责任

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK