如何解决IntelliJ idea的maven工程提示的Cannot resolve xxxxx

idea修改了一些配置,然后倒入项目后,又修改了maven中setting配置后,加载pom.xml时,总是提示Cannot Resolve xxxxx,所有的jar都无法下载了。

解决办法:

找到C:\Users\lenovo\AppData\Local\JetBrains\IntelliJIdea2020.1\log下idea.log,打开查看发现这样一句错误

Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public) in offline mode and the artifact org.apache.maven.plugins:maven-site-plugin:jar:3.3 has not been downloaded from it before.
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:260)
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:124)
	... 17 more
Caused by: java.lang.RuntimeException: org.eclipse.aether.transfer.ArtifactNotFoundException: Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public) in offline mode and the artifact org.apache.maven.plugins:maven-site-plugin:jar:3.3 has not been downloaded from it before.
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:369)
	... 21 more

提示“无法在脱机状态下访问”

想起来自己之前对idea做过一些设置,打开菜单栏,file -> setting ,找到maven查看,右侧有一个work offline,取消掉勾选。保存退出,重新下载。

如何解决IntelliJ idea的maven工程提示的Cannot resolve xxxxx_第1张图片

选择右侧maven,重新加载,Reimport!!ok,解决问题。

这里主要记录自己的解决方法,仅供大家学习参考。

你可能感兴趣的:(IDEA,java,Maven,intellij,idea,java,maven)