用私服修复Maven仓库依赖引用(加载)不下来的问题

一、我在我的项目中向引用一Maven包
在Maven仓库中是有这个依赖的
Maven仓库
这里写图片描述

二、我照着在Maven中依赖地址,在项目Pom.xml文件中引用了该依赖

<!-- https://mvnrepository.com/artifact/org.ethereum/ethereumj-core -->
<dependency>
    <groupId>org.ethereum</groupId>
    <artifactId>ethereumj-core</artifactId>
    <version>1.7.2-RELEASE</version>
</dependency>

三、但是我在启动项目的时候,再编译的时候就不能通过,会报这个包相关的一系列问题
这里写图片描述
具体如下:
大意就是中央仓库没有这个包

[ERROR] Failed to execute goal on project usdgservice: Could not resolve dependencies for project com.gws:usdgservice:jar:1.0.0: 
Failure to find org.ethereum:solcJ-all:jar:0.4.8 in http://central.maven.org/maven2/ was cached in the local 
repository, resolution will not be reattempted until the update interval of central-repository has elapsed or updates are forced -> [Help 1]

那么就奇怪啦,为什么明明有的却看不到呢?

四、那么来看一下整个以太坊的包的情况
尽管活跃度很高,但是可以看到使用量都为0。
证明想要靠利用中央仓库引用这个Jar吧现阶段是不能够的。
这里写图片描述

五、那么现在就需要发挥我们的私服的优势了
首先将包下载下来
这里写图片描述

六、在私服中上传包
这里写图片描述

Group、Artfact和Version要和引用的一样,packaging选择对应上传包的后缀,例如jar包。

<!-- https://mvnrepository.com/artifact/org.ethereum/ethereumj-core -->
<dependency>
    <groupId>org.ethereum</groupId>
    <artifactId>ethereumj-core</artifactId>
    <version>1.7.2-RELEASE</version>
</dependency>

注意:
1.Select Artifact(s) to Upload可以选择本地需要上传的包。
Classifier不填。
2.Add Artifact将选定的文件添加进来。
3.Upload Artifact(s) 上传文件。

七、上传完成后,看看是否和项目中Pom.xml一样。
这里写图片描述

八、最后再启动本地的项目就会发现一切Ok了。
当然:maven的settings.xml一定要添加自己的Maven私服配置。

settings.xml
   <mirror>
      <id>fzm-nexus</id>
      <name>Central Repository</name>
      <mirrorOf>*</mirrorOf>
      <url>http://114.55.91.220:8081/nexus/content/groups/public</url>
    </mirror>

九、最后启动,会发现一切都好啦。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值