zoukankan      html  css  js  c++  java
  • maven package

    Shell Script

    #!/bin/bash
    #-----------------------------------------------
    # FileName: pack.sh
    # Reversion: 1.2
    # Date: 2017/06/15
    # Author: zhengwenqiang
    # Email: gloryzheng@126.com.cn
    # Description: mvn package with specialized maven profile.
    # Notes: 
    # Execute this script with GNU environment which cound be initialized through installation of mingw on windows.
    # Copyright: 2017(c) zhengwenqiang
    # License: GPL
    #-----------------------------------------------
    
    if [ -n $M2_HOME -o -n $MAVEN_HOME ] ; then
    # delete target directory.
        [ -d target ] && mvn clean
    # package war file with profile which id is 'deploy'
        [ $? -eq 0 ] && mvn package -Pdeploy
    elif [ -z $M2_HOME -a -z $MAVEN_HOME ] ; then
        echo "could not exec mvn cmd, error!"
    fi 

    pom.xml

    <profiles>
        <profile>
        <!-- 批量部署 -->
        <id>deploy</id>
        <properties>
        <finalName>warName</finalName>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <configuration>
                                <target>
                                    <copy todir="${basedir}/target/classes/" overwrite="true">
                                    <fileset dir="${basedir}/release/deploy/resources/"/>
                                    </copy>
                                    <copy todir="${basedir}/src/webapp/WEB-INF/" overwrite="true">
                                    <fileset dir="${basedir}/release/deploy/WEB-INF/"/>
                                    </copy>
                                </target>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        </profile>
    </profiles>

    Project Structure

  • 相关阅读:
    通过USB转TTL串口下载stm32程序
    实验一:基于STM32F1的流水灯实验(库函数)
    opencv 常用头文件介绍
    OpenCV 1.0在VC6下安装与配置(附测试程序)
    在Angularjs使用中遇到的那些坑
    js和ts关于遍历的几个小总结
    angularjs的启动方式
    关于跨域和如何解决跨域问题的小结
    TypeScript(入门)
    截取字符串部分汇总
  • 原文地址:https://www.cnblogs.com/zhengwenqiang/p/7017037.html
Copyright © 2011-2022 走看看