maven打包之后将jar包复制到其他目录

<build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                <execution>
                    <id>delete</id>
                    <phase>clean</phase>
                    <configuration>
                        <target>
                            <delete file="docker/${project.artifactId}.${project.packaging}"></delete>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
                <execution>
                    <id>copy</id>
                    <phase>package</phase>
                    <configuration>
                        <target>
                            <copy file="target/${project.artifactId}.${project.packaging}" tofile="docker/${project.artifactId}.${project.packaging}"></copy>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>