maven上传文件和执行linux命令

来源:互联网 发布:单片机控制语音芯片 编辑:程序博客网 时间:2024/06/14 16:05
<plugins>
    <plugin>
       <groupId>org.codehaus.mojo</groupId>  
       <artifactId>wagon-maven-plugin</artifactId>  
       <version>1.0-beta-5</version>  
      <executions>
        <execution>
          <id>default-cli</id>
          <phase>integration-test</phase>
          <goals>
            <goal>upload</goal>
            <goal>sshexec</goal>
          </goals>
          <configuration>
            <serverId>snapshots</serverId>  
            <fromDir>H:\product\m-process-svc\m-process-web\target</fromDir>
            <includes>process-svc.war</includes>
            <excludes>pom.xml</excludes>
            <url>scp://192.168.1.166</url>
            <toDir>/home/fabu</toDir>
             <commands>
              <command>sh /home/fabu/kill-tomcat-svc.sh</command>
              <command>rm -rf /opt/tomcat-svc/webapps/process-svc.war</command>
              <command>rm -rf /opt/tomcat-svc/webapps/process-svc</command>
              <command>cp /home/fabu/process-svc.war /opt/tomcat-svc/webapps/process-svc.war</command>
              <command>/etc/init.d/tomcat-svc start</command>
            </commands>
          </configuration>
          </execution>
        </executions>
        <dependencies>  
                <dependency>  
                    <groupId>org.apache.maven.wagon</groupId>  
                    <artifactId>wagon-ssh</artifactId>  
                    <version>1.0-beta-6</version>  
                </dependency>  
            </dependencies>  
        </plugin>
        <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>gbk</encoding>
</configuration>
</plugin>

        </plugins>


调用命令:mvn -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -e -U integration-test


0 0
原创粉丝点击