1、所需插件名称
Deploy to container Plugin
Jenkins SSH plugin
2、pom profiles配置
1、所需插件名称
Deploy to container Plugin
Jenkins SSH plugin
2、pom profiles配置
<profiles> <profile> <activation> <activeByDefault>true</activeByDefault> </activation> <id>develop</id> <properties> <jdbc.username>root</jdbc.username> …… </properties> …… </profile> …… </profiles> <!--包含的资源目录--> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.*</include> </includes> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <webResources> <resource> <filtering>true</filtering> <directory>src/main/webapp</directory> <includes> <include>**/*.xml</include> </includes> </resource> </webResources> </configuration> </plugin> </plugins> </build>
3、maven 打包参数 :clean install -P test
4、Deploy to container Plugin使用配置
5、新建执行更新服务器的shelljob
#关闭指定端口号的tomcat netstat-antp|awk\'/:9080/{print$NF}\'|awk-F\'/\'\'{print$1}\'|xargskill-9 #切换到tomcat目录 cd/home/appuser/apache-tomcat-x/ #删除tomcat日志logs文件夹里的全部文件 rm-frlogs/* #删除tomcatjsp文件缓存 rm-rfwork/Catalina/* #删除上一次备份应用部署文件 rm-rfbak/*~ #删除上一次备份应用war文件 rm-rfwar/*~ #将应用移到bak文件夹备份 mv-fbwebapps/w/xbak #将发布的应用war移到war目录下备份 mv-fbwebapps/tomcat/x.warwar #将发布的应用移到指定的虚拟主机下 mv-fbwebapps/tomcat/xwebapps/w/ #启动tomcat ./bin/startup.sh
免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:operations@xinnet.com进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。