maven-antrun-plugin插件
设置打包目录
运维的通用模版可能从项目根目录获取

<plugins>
<!-- 配置Antrun插件(仅子模块需要) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<!-- 动态复制到父项目根目录 -->
<copy
file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
tofile="../target/${project.artifactId}.jar"
overwrite="true"
/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

浙公网安备 33010602011771号