maven pom.xml 文件plugins里增加
<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://hadoop:pwd@ip:/opt/17173/soa/</targetPath>
<file>${project.build.directory}/${project.artifactId}-${project.parent.version}-assembly.zip</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://hadoop:pwd@ip :/opt/17173/soa/</location>
<commands>
<command>ls -al; ${project.artifactId}-${project.parent.version}/bin/stop.sh</command>
<command>rm -rf ${project.artifactId}-${project.parent.version}</command>
<command>unzip ${project.artifactId}-${project.parent.version}-assembly.zip</command>
<command>${project.artifactId}-${project.parent.version}/bin/start.sh</command>
</commands>
</configuration>
</execution>
</executions>
</plugin>
command里面命令自己编写,可以写一行用;分开多个命令,也可以写多个command
然后编写一个
integration-test.bat
call mvn -X clean integration-test -DskipTests=true
就可以很容易实现自动部署啦!
相关推荐
Maven使用tomcat8-maven-plugin插件
sshexec-maven-plugin 基于Jsch的ssh的文件上传和命令执行的插件 pom.xml配置
maven3-plugin-3.0.1-sources.jar
解决tomcat8-maven-plugin-3.0-r1655215.jar阿里云同有的问题。放到路径org\apache\tomcat\maven\tomcat8-maven-plugin\3.0-r1655215\就可以了
009 maven插件spring-boot-maven-plugin
maven-project-info-reports-plugin-2.2.jar
ECLIPSE MAVEN3插件文件(eclipse-maven3-plugin工具)
maven-tomcat-plugin让maven与tomcat配合得很好。它可以把应用部署到Tomcat服务器,也可以把tomcat作为内嵌服务器启动,就像jetty一样。 使用JPDA启动tomcat的远程调试功能。这样就能与eclipse配合起来,轻松地实现...
maven-deploy-plugin-2.8.2.jar
maven-plugin-parameter-documenter-2.0.jar
maven-resources-plugin-2.4.1.jar
maven-jar-plugin-3.1.1.jar
maven-deploy-plugin-2.7.jar
dockerfile-maven-plugin 支持 maven 直接发布项目至 docker 镜像库
maven-install-plugin-2.4.jar
maven是个项目管理工具,如果我们不告诉它我们的代码要使用什么样的jdk版本编译的话...maven的默认编译使用的jdk版本貌似很低,使用maven-compiler-plugin插件可以指定项目源码的jdk版本,编译后的jdk版本,以及编码。
eclipse-maven3-plugin插件 包含apache-maven-3.3.9和eclipse-maven3-plugin
scalate.zip,scalatelift与scalate的集成
maven-project-info-reports-plugin-2.1.jar
maven-site-plugin-3.3.jar