拷贝jar包到指定目录
使用maven-antrun-plugin,可以将jar包拷贝到指定目录下
以下示例是将jar包拷贝到上级路径的target目录下,父目录使用${project.parent.relativePath}/..
是因为如果只用${project.parent.relativePath}
返回的是pom
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>copy-jars</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="copy jars"/>
<copy file="target/${project.artifactId}-${project.version}.jar"
todir="${project.parent.relativePath}/../target">
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>