在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