为了账号安全,请及时绑定邮箱和手机立即绑定

maven本地仓库存在为什么还要连接外网下载?

maven本地仓库存在为什么还要连接外网下载?

函数式编程 2019-02-24 03:09:32
我们配置有私服的maven中央仓库,但是前几天停电服务器有问题了,现在私服的中央仓库连接不上,可是我在一个项目中需要下载jar包的时候,已经连接外网把jar下载下来了,然后我就又把地址改成私服的不能连接的中央仓库了(工程需要,我也不知道怎么回事),可是在又执行的时候,本地工程还要连接中央仓库进行下载,是不是从不同仓库下载下来的jar不能共用呢? [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/mybatis/generator/mybatis-generator-maven-plugin/1.3.2/mybatis-generator-maven-plugin-1.3.2.pom [WARNING] Failed to retrieve plugin descriptor for org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2: Plugin org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.mybatis.generator:mybatis-generator-maven-plugin:jar:1.3.2 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.3 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2 [INFO] Downloading: http://10.12.12.108:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml 可是如果这个工程我连接到公网的仓库就可以运行,连接本地私服仓库就不能运行!! 终极问题 : 为什么我本地仓库已经存在这个jar包了,运行的时候,工程还要去中央仓库下载呢?
查看完整描述

3 回答

?
海绵宝宝撒

TA贡献1809条经验 获得超8个赞

可能是jar版本 或者 配置的jdk版本不一致 引起的!

查看完整回答
反对 回复 2019-03-01
?
梦里花落0921

TA贡献1772条经验 获得超6个赞

没有日志不好说具体什么原因引起的,提供个思路:
1.可能是本地jar包的版本不对,先删掉本地jar包,并把相应目录下以.lastupdated结尾的文件删掉
2.重新编译:mvn clean install

查看完整回答
反对 回复 2019-03-01
?
浮云间

TA贡献1829条经验 获得超4个赞

请问您解决这个问题了吗,我也遇到了同样的问题,而且我这边也用了nexus

查看完整回答
反对 回复 2019-03-01
  • 3 回答
  • 0 关注
  • 6757 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信