Java Maven指定jar生成位置

pom.xml

<plugin>
    <!--把jar包复制到指定的位置-->
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>copy</id>
            <phase>package</phase>
            <configuration>
                <target>
                    <!--todir指定要复制到哪个位置,这里我设置为空则表示复制到当前项目下-->
                    <copy todir="E:/jar">
                        <fileset dir="${project.build.directory}">
                            <include name="${project.artifactId}-${project.version}.jar" />
                        </fileset>
                    </copy>
                </target>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>
posted @ 2021-09-07 16:58  New_HackerHK  阅读(253)  评论(0编辑  收藏  举报