这期内容当中小编将会给大家带来有关Maven项目实现打Jar包并添加依赖,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
使用maven-dependency-plugin插件
子项目中的pom.xml文件中,添加以下maven-dependency-plugin依赖,这个maven-dependency-plugin依赖的作用就是自动拷贝jar包到target目录
这是我的Maven子项目打包,指定了将它的依赖的父项目中的jar包拷贝到target下的lib目录
org.apache.maven.plugins maven-dependency-plugin copy-dependencies prepare-package copy-dependencies ${project.build.directory}/lib true true true