maven 如何让所依赖的jar都被打包在一个jar里面呢
2014-09-22 21:51
405 查看
How creates a single JAR file that includes all of the bytecode from
the project as well as the unpacked bytecode from all of the dependencies.
1. Assembly plugin 插件
Once you’ve added this configuration, you can build the assembly by running the assembly:assembly
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包都在里面。
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>
Once you’ve added this configuration, you can build the assembly by running the assembly:assembly
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包都在里面。
相关文章推荐
- maven中如何将所有引用的jar包打包到一个jar中
- maven打包一个包含依赖jar包的可执行jar
- maven中如何将所有引用的jar包打包到一个jar中
- Maven:将依赖jar包打包到一个目录
- maven中如何将所有引用的jar包打包到一个jar中
- 如何将maven项目包含工程依赖打包成可执行的jar
- 使用maven的maven-assembly-plugin将jar包依赖打包到一个jar文件
- 如何在IDEA中创建maven项目,然后把项目所要的依赖整体打成一个jar包
- maven中如何将所有引用的jar包打包到一个jar中
- Maven:将依赖jar包打包到一个目录
- maven 将依赖包打包到jar 里面
- 如何用Maven把依赖也打到可自动执行的jar里面?
- maven项目,多个依赖,打成一个可执行jar包,可根据profiles进行打包,出现的Could not find or load main class的解决方法。
- maven打包的时候 ,将依赖包 打进同一个jar包命令 mvn assembly:assembly -DskipTests
- 使用Maven将所有的依赖打包到一个jar里
- maven中如何将所有引用的jar包打包到一个jar中
- Maven把所有依赖的jar打包到一个jar中(相当于fat jar)
- 使用maven的maven-assembly-plugin将jar包依赖打包到一个jar文件中
- 如何将maven项目打包成可执行的jar
- 如何让maven 将工程依赖的jar 复制到WEB-INF/lib 目录下?