我是靠谱客的博主 伶俐戒指,这篇文章主要介绍Maven导入本地的jar包,现在分享给大家,希望可以做个参考。

Maven导入本地的jar包

场景:在项目中pom文件中写有的依赖下载不下来时,我们需要在网上找到jar下载下来,再导入到maven仓库

项目中pom.xml依赖写法:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>

终端输入命令:

mvn install:install-file 
-Dfile=E:mvnspring-context-support-3.1.0.RELEASE.jar  
-DgroupId=org.springframework 
-DartifactId=spring-context-support 
-Dversion=3.1.0.RELEASE 
-Dpackaging=jar 
-DgeneratePom=true

解读:
-Dfile=本地jar包全路径
-DgroupId=pom文件中groupId
-DartifactId=pom文件中artifactId
-Dversion=pom文件中version
-Dpackaging=jar
-DgeneratePom= true (是否生成pom文件,ture:生成,false:不生成)

最后

以上就是伶俐戒指最近收集整理的关于Maven导入本地的jar包的全部内容,更多相关Maven导入本地内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(140)

评论列表共有 0 条评论

立即
投稿
返回
顶部