当前位置 : 主页 > 编程语言 > java >

maven package

来源:互联网 收集:自由互联 发布时间:2023-02-04
#!/bin/bash#-----------------------------------------------# FileName: pack.sh# Reversion: 1.2# Date: 2017/06/15# Author: zhengwenqiang# Email:# Description: mvn package with specialized maven profile.# Notes: # Execute this script with GNU

 

#!/bin/bash#-----------------------------------------------# FileName: pack.sh# Reversion: 1.2# Date: 2017/06/15# Author: zhengwenqiang# Email:# 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 -Pdeployelif [ -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

maven package_sed

 

上一篇:GC选择之CMS 并发标记清除
下一篇:没有了
网友评论