How creates a single JAR file that includes all of the bytecode from
goal. In the following screen listing, the assembly:assembly goal is executed after the Maven build
reaches the install lifecycle phase:
$ mvn install assembly:assembly
the project as well as the unpacked bytecode from all of the dependencies.
1. Assembly plugin 插件
配置 Maven Assembly Descriptor。 pom文件内
<project>
[...]
<build>
<plugins>
<plugin>
Maven by Example
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
goal. In the following screen listing, the assembly:assembly goal is executed after the Maven build
reaches the install lifecycle phase:
$ mvn install assembly:assembly
配置完pom 文件后,运行命令 mvn install assembly:assembly ,
本地仓库找打你的jar 文件,打开后发现依赖的jar包都在里面。