Maven依赖中类似was cached in the local repository样的错误

我们在使用maven编译一个项目时经常会遇到诸如此类的问题。


Could not get the value for parameter encoding for plugin execution default-resources

Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.codehaus.plexus:plexus-utils:jar:1.1 in http://nexusserver:8081/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of mirr...

was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> 

大体意思是jar包没有下载完整,不过也要分两种情况。

一种可能就是本地没有下载完整,这里的原因可能第一次下载由于网络原因不成功,之后maven也没在尝试。

引用

This is often a false positive. Imagine you have a connection issue lasting only 5 seconds when Maven 3 tries to download a dependency, it will mark this dependency as unavailable
for a delay. And thus will prevent you from replaying the build command even if the network issue is fixed.

Just run the command with the -U option. Even if its description applies to snapshots, it seems to also fix the error if it occurred on a release.

Example: mvn -U clean package

此外,我们可以在setting.xml中增加updatePolicy策略

setting.xml指导

http://maven.apache.org/ref/3.3.1/maven-settings/settings.html

在setting.xml的schema中有这样一个描述

schema

http://maven.apache.org/xsd/settings-1.0.0.xsd

另一种情况就是我们依赖的nexus也没有下载完整,这时候可能是配置的中央仓库代理仓库根本就不存在此jar,或者需要在第三方仓库中才能找到,此时我们应该尝试检查和配置代理仓库。

时间: 2024-05-25 05:04:40

Maven依赖中类似was cached in the local repository样的错误的相关文章

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interv

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Origi

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval o

pom.xml报错: Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are fo

maven build失败 (Failure to find io.renren:renren-security:pom:3.2.0 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository...)

今天mvn clean package一个子工程(renren-admin)时报错: Failed to execute goal on project renren-admin: Could not resolve dependencies for project io.renren:renren-admin:war:3.2.0: Failed to collect dependencies at io.renren:renren-common:jar:3.2.0: Failed to rea

MAVEN奇葩问题was cached in the local repository, resolution will not be reattempted until

[ERROR] Non-resolvable import POM: Failure to find org.springframework.cloud:spring-cloud-dependencies:pom:Finchley.M7 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the upda

Maven依赖中的scope详解

原文链接:https://blog.csdn.net/kimylrong/article/details/50353161 原创kimy 发布于2015-12-18 17:36:48 阅读数 109197 收藏展开 Maven的一个哲学是惯例优于配置(Convention Over Configuration), Maven默认的依赖配置项中,scope的默认值是compile,项目中经常傻傻的分不清,直接默认了.今天梳理一下maven的scope. scope的分类compile默认就是com

关于maven依赖中的<scope>provided</scope>使用

今天开发web的时候,需要用到servlet-api,于是在pom.xml中添加依赖 <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0-alpha-1</version> </dependency> 通过插件启动tomcat的时候,报错,里面有一段是这样的: Caused

maven依赖中部分依赖出现深灰色可能的解决方案

问题如图: 1.按照网上不少同志建议的:直接右键项目,强制更新maven,即Update project: 2.也是我遇到的问题,发现该依赖包已经下载,但是由于 Index downloads are disabled的问题解决方法如下: 原因:应该是maven自动下载index组件的功能没有开启: "Window" --> "Preferences" and choose Maven in the left side.勾选Download repositor

解决maven执行命令时提示:cached in the local repository

可能原因是maven私服找不到相关jar. 我们可以到http://mvnrepository.com中找到相应的jar,上传到私服即可. 然后到本地仓库中找到相应的文件夹路径,删除相关文件夹后,再执行maven命令.

解决 Maven was cached in the local repository, resolution will not be reattempted until the update interv

问题原因 Maven默认会使用本地缓存的库来编译工程,对于上次下载失败的库,maven会在~/.m2/repository/<group>/<artifact>/<version>/目录下创建xxx.lastUpdated文件,一旦这个文件存在,那么在直到下一次nexus更新之前都不会更新这个依赖库. 解决办法: 删除vvv~/.m2/repository/<group>/<artifact>/<version>/目录下的*.last