<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>3.3.0</version> <configuration> <appendAssemblyId>false</appendAssemblyId> <finalName>mq-test</finalName> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <addClasspath>true</addClasspath>
<!-- mainClass换成自己main路径 -->
<mainClass>com.wkf.Test</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
在pom.xml中插入上述代码,在项目根目录下,执行 mvn clean package -Dmaven.test.skip=true 即可
标签:assembly,package,jar,maven,test,true,打包 From: https://www.cnblogs.com/gavinwu-blog/p/16932409.html