首页 > 其他分享 >maven打包配置

maven打包配置

时间:2023-01-23 19:12:32浏览次数:44  
标签:lib 配置 maven dependencies plugins apache org 打包

在pom.xml文件中插入

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <!--   MANIFEST.MF 中 Class-Path -->
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>cn.zoom.wqz.filter.Application</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <!--      配置依赖包      -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!--              将依赖包打包至target下的lib目录              -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

标签:lib,配置,maven,dependencies,plugins,apache,org,打包
From: https://www.cnblogs.com/unscrupulously/p/17065390.html

相关文章