Maven: Maven Antrun Plugin configuration to copy package from target to basedir and rename it

来源:互联网 发布:java中的finally 编辑:程序博客网 时间:2024/05/29 13:56

Add the Maven Antrun Plugin to the pom.xml

<plugin>    <artifactId>maven-antrun-plugin</artifactId>    <executions>        <execution>            <id>deploy</id>            <phase>package</phase>            <configuration>                <tasks>                    <copy todir="${project.basedir}">                        <fileset dir="target">                            <include name="${build.finalName}.${project.packaging}" />                        </fileset>                    </copy>                    <move file="${project.basedir}/${build.finalName}.${project.packaging}" tofile="${project.basedir}/name-you-want.jar"/>                </tasks>            </configuration>            <goals>                <goal>run</goal>            </goals>        </execution>    </executions></plugin>

After executing, the package will be copied to the base directory from target directory and then rename it to what you want.

0 0
原创粉丝点击