Maven把jar包打到指定目錄下

在 maven的pom文件中添加:

<!-- 把jar包拷貝到指定目錄位置 -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <copy todir="d:/yssjar">
                                    <fileset dir="${project.build.directory}">
                                        <include name="${project.artifactId}-${project.version}.jar" />
                                    </fileset>
                                </copy>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

示例圖:

相關文章
相關標籤/搜索