maven 插件 一键远程发布部署(jar war)
来源:互联网 发布:mac终端获取当前路径 编辑:程序博客网 时间:2024/06/05 03:48
<build><pluginManagement><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.6</source><target>1.6</target></configuration></plugin><!-- 集成打包 config lib sh脚本 --><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptor>src/main/assembly/assembly.xml</descriptor></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin><!-- copy到远程服务器 --><plugin><groupId>com.github.goldin</groupId><artifactId>copy-maven-plugin</artifactId><version>0.2.5</version><executions><execution><id>deploy-archive</id><phase>integration-test</phase><goals><goal>copy</goal></goals><configuration><resources><resource><targetPath>scp://bppf_bgw:123456@192.168.87.3:/u1/bppf_bgw</targetPath><file>${project.build.directory}/${project.build.finalName}-assembly.tar.gz</file></resource></resources></configuration></execution></executions></plugin><!-- 启动脚本 --><plugin><groupId>com.github.goldin</groupId><artifactId>sshexec-maven-plugin</artifactId><version>0.2.5</version><executions><execution><id>unpack-archive</id><phase>integration-test</phase><goals><goal>sshexec</goal></goals><configuration><location>scp://bppf_bgw:123456@192.168.87.3:/u1/bppf_bgw</location><commands><!-- 不加会找不到java命令 --><command>export PATH=$PATH:/opt/jdk1.6.0_32/bin</command><!-- 不加程序启动会乱码 --><command>export LANG=zh_CN.GBK</command><command>${project.build.finalName}/shutdown.sh</command><command>rm -rf ${project.build.finalName}</command><command>tar -zxf ${project.build.finalName}-assembly.tar.gz</command><command>cd ${project.build.finalName}</command><command>./startup.sh</command></commands></configuration></execution></executions></plugin><!-- 远程部署web项目到tomcat --><plugin><groupId>org.codehaus.mojo</groupId><artifactId>tomcat-maven-plugin</artifactId><configuration><url>http://192.168.87.3:8920/manager</url><server>tomcatServer</server><path>/${project.build.finalName}</path></configuration></plugin></plugins></pluginManagement></build>
assembly.xml
<assembly><id>assembly</id><formats><format>tar.gz</format></formats><includeBaseDirectory>true</includeBaseDirectory><fileSets><!-- 启动脚本 --><fileSet><directory>src/main/assembly/bin</directory><outputDirectory>./</outputDirectory><fileMode>0755</fileMode></fileSet><!-- 配置文件 --><fileSet><directory>/config</directory><outputDirectory>config</outputDirectory><fileMode>0644</fileMode></fileSet></fileSets><!-- 依赖jar包 --><dependencySets><dependencySet><outputDirectory>lib</outputDirectory></dependencySet></dependencySets></assembly>
listen.sh
#!/bin/bash#Author:huangtao#Date:2014-03-04dirPath=`pwd`export CLASSPATH=$CLASSPATH:${dirPath}/lib/*monitor_params="-Dcom.sun.management.jmxremote.port=7779 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.87.3"java -DAppName=SAG-SERVICE-PAY-JAR -XX:PermSize=200M -Xms512M -Xmx1024M -Xss128k $monitor_params com.bestpay.sag.services.net.NetServiceStart
startup.sh
#!/bin/bash#create by huangtao, 2012-03-04 echo ">>> SAG-SERVICE-PAY service command."#rundir="/u1/bppf_bgw/sag-service/sag-service-pay"port="8778"pid=`jps -v | grep SAG-SERVICE-PAY-JAR | awk '{print $1}'`if [ -z "$pid" ]then echo ">>> Booting SAG-SERVICE-PAY service..." #echo ">>> Appending console log to ${rundir}/console.log"echo ">>> Appending console log to ./console.log"#nohup ${rundir}/listen.sh > ${rundir}/console.log 2>&1 &nohup ./listen.sh >> console.log 2>&1 &else echo ">>> [ERROR]Service already running, aborted." exit -1fiexit 0
shutdown.sh
#!/bin/bash#create by lingyunzhi, 2012-6 echo ">>> SAG-SERVICE-JAY service command. Created by lingyunzhi [tisson]."pid=`jps -v | grep SAG-SERVICE-PAY-JAR | awk '{print $1}'`if [ -z "$pid" ]thenecho ">>> [ERROR] Service is not running."elseecho ">>> Running service pid is: $pid" kill -9 ${pid}fiexit 0
0 0
- maven 插件 一键远程发布部署(jar war)
- maven远程发布war
- maven远程发布war
- maven远程发布war
- maven部署war远程服务器
- maven一键部署tomcat war包
- maven一键部署tomcat war包
- maven一键部署tomcat war包
- Maven远程部署war包到Tomcat
- java 一键部署war包,jar包
- 使用Maven实现一键部署war到Tomcat
- Maven -- clean deploy发布jar或war包到远程服务器上报“非法字符: \65279 ”错误的解决方法
- maven 发布jar包到远程仓库,
- maven发布jar到远程仓库
- Maven 发布jar包到远程仓库
- maven部署jar 到远程仓库
- maven发布jar、aar、war等到中央库(Central Repository)的步骤
- 利用Maven和Cargo远程部署war到Tomcat7
- 高效开发 Android App 的 10 个建议 from OSChina
- android系统应用在未root的情况下启动root权限命令方法
- 字节对齐&内存管理
- CStatic控件的基本使用
- c语言库函数:memcpy
- maven 插件 一键远程发布部署(jar war)
- VC CComboBox控件自动匹配输入的关键字
- 浅谈网站SEO常见的作弊方法
- VS2010 使用TeeChart绘图控件 - 之二 - 绘制图形(折线图,柱状图)
- Python正则表达式指南
- java配置plupload
- Android 客户端与服务器交互方式
- 一段python从mysql数据库中取数据并且求平均值的代码
- PCSC-LITE使用及移植总结