idea中maven项目打包并输出到指定目录下

maven的pom.xml增加如下构建内容

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <!-- 指定打包的jar包输出路径 -->
                    <outputDirectory>C:\MentorGraphics\CHS2015\plugins\zk20s-docgen</outputDirectory>
                    <!--不打入jar包的文件类型或者路径 -->
                    <!--                    <excludes>-->
                    <!--                        <exclude>**/*.properties</exclude>-->
                    <!--                        <exclude>**/*.xml</exclude>-->
                    <!--                        <exclude>**/*.yml</exclude>-->
                    <!--                        <exclude>static/**</exclude>-->
                    <!--                        <exclude>templates/**</exclude>-->
                    <!--                    </excludes>-->
                </configuration>
            </plugin>
        </plugins>
    </build>

然后执行生命周期里的package:双击package

查看输出结果

猜你喜欢

转载自blog.csdn.net/zp357252539/article/details/129693333