IntelliJ从12版本升级到13版本后,以下maven相关插件无法解决:

org.apache.maven.plugins:maven-clean-plugin:2.4.1
org.apache.maven.plugins:maven-deploy-plugin
org.apache.maven.plugins:maven-install-plugin
org.apache.maven.plugins:maven-site-plugin

在使用IntelliJ 12时,这些不在插件列表中。不知何故,它们在更新后被添加,现在IntelliJ抱怨无法找到它们。我可以在哪里从列表中删除这些插件或通过安装它们来解决问题?

我可以运行maven目标干净和编译没有问题,但配置文件/插件在IDE中显示红色警告。

8年后编辑:也请看看这里所有其他好的答案。公认的答案是一个常见的解决方案,但可能不适用于您或您的IDE版本


当前回答

如果工件无法解决。 进入.m2/存储库目录 并检查你没有这样的文件:

build-helper-maven-plugin-1.10.pom.lastUpdated

如果文件夹中没有任何工件,只需删除它,并尝试在IntelliJ中重新导入。

这些文件的内容如下:

#NOTE: This is an Another internal implementation file, its format can be changed without prior notice.
#Fri Mar 10 10:36:12 CET 2017
@default-central-https\://repo.maven.apache.org/maven2/.lastUpdated=1489138572430
https\://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.codehaus.mojo\:build-helper-maven-plugin\:pom\:1.10 from/to central (https\://repo.maven.apache.org/maven2)\: connect timed out

没有*。lastUpdated文件,IntelliJ(顺便说一下是Eclipse)可以重新加载丢失的内容。

其他回答

如果工件无法解决。 进入.m2/存储库目录 并检查你没有这样的文件:

build-helper-maven-plugin-1.10.pom.lastUpdated

如果文件夹中没有任何工件,只需删除它,并尝试在IntelliJ中重新导入。

这些文件的内容如下:

#NOTE: This is an Another internal implementation file, its format can be changed without prior notice.
#Fri Mar 10 10:36:12 CET 2017
@default-central-https\://repo.maven.apache.org/maven2/.lastUpdated=1489138572430
https\://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.codehaus.mojo\:build-helper-maven-plugin\:pom\:1.10 from/to central (https\://repo.maven.apache.org/maven2)\: connect timed out

没有*。lastUpdated文件,IntelliJ(顺便说一下是Eclipse)可以重新加载丢失的内容。

对我来说,我手动下载它们,把主题放在我的。m2文件夹里,然后我使缓存无效并重新启动(我使用Intellij IDEA)。 具体步骤如下:

< groupId > org . codehaus < / groupId >的魔力。 < artifactId > jdepend-maven-plugin < / artifactId > < 2.0版本> < /版>

I go to https://mvnrepository.com/ then serch for jdepend-maven-plugin choose the version 2.0 In Files go and click on View All Download this files jdepend-maven-plugin-2.0.jar jdepend-maven-plugin-2.0.jar.sh1 jdepend-maven-plugin-2.0.pom jdepend-maven-plugin-2.0.pom.sh1 go to .m2 folder then org/codehaus/mojo Create folder with name jdepend-maven-plugin inside with name 2.0 inside put the 4 files downloaded befor. create file with name _remote.repositories open it with text editor and write inside

jdepend-maven-plugin-2.0.jar中部> = jdepend-maven-plugin-2.0.pom中部> =

去intellij IDEA使缓存无效并重新启动。

多年来,我在使用maven-deploy插件时遇到了这个问题,即使我没有直接将插件包含在POM中,这个错误也出现了。作为一种解决方法,我不得不强制将带有一个版本的插件包含到我的POMs插件部分中,只是为了删除红色曲线。

在尝试了Stack Overflow上的每个解决方案后,我发现了问题:在我的.m2/repository/org/apache/maven/plugins/maven-deploy-plugin目录中,有一个版本是“X.Y”和“2.8.2”等。所以我删除了整个Maven -deploy-plugin目录,然后重新导入我的Maven项目。

因此,问题似乎是解析存储库时的IntelliJ错误。不过,我不会删除整个存储库,只删除报告错误的插件。

我遇到了同样的错误,并通过删除旧的Maven设置文件来摆脱它。然后我手动使用mvn命令更新Maven插件:

mv ~/.m2/settings.xml ~/.m2/settings.xml.old
mvn -up

最后,我在IntelliJ的Maven项目选项卡中运行了“重新导入所有Maven项目”按钮。在我的案例中,错误消失了。

在Maven设置中,我已经将Maven主目录从捆扎(Maven 3)更改为捆扎(Maven 2)。这对我很有用。试试看!