maven引入外部jar包

一、仅本地

 cmd进入jar包所在目录,执行下列命令

-Dfile:本地jar包名称     -DgroupId:groupId    -DartifactId:artifactId

 mvn install:install-file -Dfile=test.jar -DgroupId=com.csdn.test -DartifactId=test -Dversion=1.0 -Dpackaging=jar

引入依赖

<dependency> 
  <groupId>com.csdn.test</groupId>  
  <artifactId>test</artifactId>  
  <version>1.0</version> 
</dependency>

二、maven 私服 nexus 添加第三方jar包

登录Nexus后,点击右侧的“Repositories”,显示当前Nexus所管理的Repository:

默认情况下Nexus为我们创建了以下主要的Repository:

1、PublicRepositories,这是一个Repository Group,该Repository  Group包含了多个Repository,其中包含了Releases、Snapshots、ThirdParty和Central。

2、3rd party,该Repository即是存放你公司所购买的第三方软件库的地方,它是一个由Nexus自己维护的一个Repository。

3、Apache Snapshots,看名字你就应该知道这是个什么样的Repository,这是一个代理Repository,即最终的依赖还是得在Apache官网上去下载,然后缓存在Nexus中。

4、Central,这就是代理Maven Central Repository的Repository。

5、Releases,你自己的项目要发布时,就应该发布在这个Repository,他也是Nexus自己维护的Repository,而不是代理。

6、Snapshots,你自己项目Snapshot的Repository。

使用3rd party上传第三方jar包

 

 

使用第三方jar包

 

 

参考:https://www.cnblogs.com/cb0327/p/5395335.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值