本文共 1386 字,大约阅读时间需要 4 分钟。
一、我在我的项目中向引用一Maven包
在Maven仓库中是有这个依赖的二、我照着在Maven中依赖地址,在项目Pom.xml文件中引用了该依赖
org.ethereum ethereumj-core 1.7.2-RELEASE
三、但是我在启动项目的时候,再编译的时候就不能通过,会报这个包相关的一系列问题
[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包。
org.ethereum ethereumj-core 1.7.2-RELEASE
注意:
1.Select Artifact(s) to Upload可以选择本地需要上传的包。 Classifier不填。 2.Add Artifact将选定的文件添加进来。 3.Upload Artifact(s) 上传文件。七、上传完成后,看看是否和项目中Pom.xml一样。
八、最后再启动本地的项目就会发现一切Ok了。
当然:maven的settings.xml一定要添加自己的Maven私服配置。settings.xml
fzm-nexus Central Repository * http://114.55.91.220:8081/nexus/content/groups/public
九、最后启动,会发现一切都好啦。