mac删除本地仓库中所有的.lastUpdated

mac 下maven工程报错

eclipes是mac版本,java 12 启动后,创建maven工程。报错。错误如下CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.codehaus.plexus:plexus-container-default:jar:1.5.5 -> org.apache.xbean:xbean-reflect:jar:3.4: ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.xbean:xbean-reflect:jar:3.4: ArtifactResolutionException: Failure to transfer org.apache.xbean:xbean-reflect:pom:3.4 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 forced. Original error: Could not transfer artifact org.apache.xbean:xbean-reflect:pom:3.4 from/to central (https://repo.maven.apache.org/maven2): connect timed out

在terminal终端执行下面命令

find /Users/liudawei/.m2/repository -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

进入eclipse,修改pom.xml.随便删除一行,再将原来的内容拷贝回来,保存。启动重新编译即可。

我的操作是,重启eclispe,然后在做上面的操作

你可能感兴趣的:(笔记)