把本地jar包做成maven依赖的方式

一、要保证maven是安装好了的

如果打出如下命令,出现如下就可以了

C:\Users\feifei>mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: D:\service\job_tool\apache-maven-3.3.9\bin\..
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: D:\service\job_tool\jdk1.8.0_91\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

二、下载对应的jar包到自己的本地

这个自己需要安装什么,就到对应的地方下载

三、输入如下命令

mvn install:install-file -DgroupId=com.apache.poi -DartifactId=ooxml-schemas -Dversion=1.1 -Dpackaging=jar -Dfile=D:\software\computer\Google\downloads\ooxml-schemas-1.1.jar

其中
-DgroupId=com.apache.poi – 对应maven中的groupId
-DartifactId=ooxml-schemas – 对应maven中的artifactId
-Dversion=1.1 – 对应maven中的version

四、验证是否成功

如果出现如下页面说明已经成功,可以到对应的仓库中找到

C:\Users\feifei>mvn install:install-file -DgroupId=com.apache.poi -DartifactId=ooxml-schemas -Dversion=1.1 -Dpackaging=jar -Dfile=D:\software\computer\Google\downloads\ooxml-schemas-1.1.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] Installing D:\software\computer\Google\downloads\ooxml-schemas-1.1.jar to D:\service\job_tool\Maven_Repository\com\apache\poi\ooxml-schemas\1.1\ooxml-schemas-1.1.jar
[INFO] Installing C:\Users\feifei\AppData\Local\Temp\mvninstall6900655515499056493.pom to D:\service\job_tool\Maven_Repository\com\apache\poi\ooxml-schemas\1.1\ooxml-schemas-1.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.220 s
[INFO] Finished at: 2020-12-01T20:23:14+08:00
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------

有任何问题,欢迎加扫码咨询(备注好对应的技术呦)
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值