java - maven本地仓库存在为什么还要连接外网下载?
天蓬老师
天蓬老师 2017-04-18 10:24:07
0
3
843

我们配置有私服的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包了,运行的时候,工程还要去中央仓库下载呢?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
小葫芦

It may be caused by inconsistent jar version or configured jdk version!

阿神

Without the log, it’s difficult to tell the specific cause. Here are some ideas:
1. It may be that the version of the local jar package is wrong. Delete the local jar package first, and delete the files ending with .lastupdated in the corresponding directory.
2. Recompile: mvn clean install

大家讲道理

Have you solved this problem? I also encountered the same problem, and I also use nexus here

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template