maven 下载jar包手动打包本地库

1、执行打包命令:

正常maven依赖jar包的pom.xml写法如下:

<!-- (参数一):下载到本地的ojdbc-10.2.0.4.0.jar包的真实存放路径 -->
<dependency>
    <groupId>ojdbc</groupId>-----------------(参数二)
    <artifactId>ojdbc</artifactId>-----------(参数三)
    <version>10.2.0.4.0</version>------------(参数四)
</dependency>

语法:

mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar

注意必须在有pom文件的文件夹内执行才有效(项目内的pom文件目录内也有效)

实例:

mvn install:install-file -Dfile="C:\Users\zhaoyue\Desktop\commons\commons-io.jar" -DgroupId=org.apache.commons -DartifactId=commons-io -Dversion=2.6.0 -Dpackaging=jar

打包成功

在这里插入图片描述

打包报错解决(点击这里

如果标签多的话,如下:

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.2.0</version>
<classifier>tests</classifier>
</dependency>

就加一个-D参数就可以了,如下:

mvn install:install-file -Dfile=hadoop-hdfs-2.2.0-tests.jar -DgroupId=org.apache.hadoop -DartifactId=hadoop-hdfs -Dversion=2.2.0 -Dclassifier=tests -Dpackaging=jar

在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值