在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自动化部署插件sshexec-maven-plugin的更多相关文章

  1. Windows版Jenkins+SVN+Maven自动化部署环境搭建【转】

    前言 因今年公司新产品线较多,为了降低耦合,达到业务分离.重用,提高内部开发效率的目的,采用了基于服务组件.前后端分离的架构体系.与之前传统单应用架构相比,系统部署.配置更加复杂,为了能够频繁地将软件 ...

  2. Java-Maven-Runoob:Maven 自动化部署

    ylbtech-Java-Maven-Runoob:Maven 自动化部署 1.返回顶部 1. Maven 自动化部署 项目开发过程中,部署的过程包含需如下步骤: 将所的项目代码提交到 SVN 或者代 ...

  3. maven 学习---Maven自动化部署

    在项目开发中,通常是部署过程包含以下步骤 检入代码在建项目全部进入SVN或源代码库中,并标记它. 从SVN下载完整的源代码. 构建应用程序. 生成输出要么WAR或EAR文件存储到一个共同的网络位置. ...

  4. Maven自动化部署

    在项目开发中,通常是部署过程包含以下步骤 检入代码在建项目全部进入SVN或源代码库中,并标记它. 从SVN下载完整的源代码. 构建应用程序. 生成输出要么WAR或EAR文件存储到一个共同的网络位置. ...

  5. 关于maven的规则插件:Maven Enforcer plugin

    Maven提供了Maven-Enforcer-Plugin插件,用来校验约定遵守情况(或者说校验开发环境).比如JDK的版本,Maven的版本,开发环境(Linux,Windows等),依赖jar包的 ...

  6. jenkins之自动化部署github上maven项目

    部署流程:将代码从github上拉取下来,使用maven打包,将打包后的jar通过ssh发送到服务器上,然后构建docker镜像,运行容器. 1.安装插件 如果是第一次使用jenkins,需要检查并确 ...

  7. jenkins自动化部署gitlab上maven程序

    部署流程:将代码从gitlab上拉取下来,使用maven打包,将打包后的jar通过ssh发送到服务器上,运行jar程序 注意:本文需要安装一些插件Publish Over SSH 1.新建任务 在主页 ...

  8. maven热部署插件-jetty

    作者:小勇Oo 关于maven-jetty-plugin的说明: pom文件中: <build> <finalName>freemarker</finalName> ...

  9. idea自动化部署插件 Alibaba Cloud Toolkit 使用记录

    官方安装文档和使用说明 https://help.aliyun.com/product/29966.html?spm=a2c4g.11186623.6.540.6efa6029JhlPfx 是什么? ...

随机推荐

  1. UITapGestureRecognizer

    UITapGestureRecognizer IOS的手势非常多, 但是特别容易其他视图起冲突的手势,要数UITapGestureRecognizer 于是有了gestureRecognizerSho ...

  2. svn报错 400 Bad Request

    MyEclipse中的svn,commit经常报错 Error: Commit failed (details follow):  Error: At least one property chang ...

  3. 使用JDBC获取各数据库的Meta信息——表以及对应的列

    先贴代码,作为草稿: 第一个是工具类, MapUtil.java [java] view plain copy import java.util.ArrayList; import java.util ...

  4. maven常见问题

    maven常见错误: 一..在Eclipse导入已存在工作空间的项目,出现 情况1: Scanning errors (1):1 Could not read pom.xml 就是pom.xml出现了 ...

  5. android设置图片自适应控件大小

    在XML文件的ImageView属性中加上:android:scaleType="fitXY"

  6. php友好格式化时间

    php格式化时间显示 function toTime($time) {//$time必须为时间戳 $rtime = date("Y-m-d H:i",$time); $htime ...

  7. Counting Bits

    Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the ...

  8. 烦烦烦SharePoint2013 以其他用户登录和修改AD域用户密码

    sharepoint默认是没有修改AD密码 和切换 用户的功能,这里我用future的方式来实现. 部署wsp前: 部署后 点击以其他用户身份登录 点击修改用户密码: 这里的扩展才菜单我们用Custo ...

  9. coco2dx实现翻拍效果

    昨天吃饭看见同事演示他做的翻牌效果,感觉不错,我心血来潮也来搞个,很简单直接上代码. class FlipCard : public CCNode { public: CREATE_FUNC(Flip ...

  10. codeforces A. Jeff and Digits 解题报告

    题目链接:http://codeforces.com/problemset/problem/352/A 题目意思:给定一个只有0或5组成的序列,你要重新编排这个序列(当然你可以不取尽这些数字),使得这 ...