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版本


当前回答

多年来,我在使用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错误。不过,我不会删除整个存储库,只删除报告错误的插件。

其他回答

这可能会帮助到某个人

我也遇到过类似的问题,我的系统无法解决代理服务器 这样就连上了本地wifi热点。

我的情况:

maven-javadoc-plugin with version 3.2.0 is displayed red in IntelliJ. Plugin is present in my local maven repo. Re-imported maven million times. Ran mvn clean install from the command line N times. All my maven settings in IntelliJ are correct. Tried to switch between Bundled and non-bundled Maven. Tried do delete the whole maven repo and to delete only the plugin from it. Nothing of the above worked. The only thing that almost always helps with modern IntelliJ IDEA versions is "Invalidate caches / Restart". It helped this time as well. maven-javadoc-plugin is not red anymore, and I can click on it and to to the source pom file of the plugin.

从maven工具窗口运行Force重新导入。如果不工作,Invalidate你的缓存(文件> Invalidate缓存)并重新启动。等待IDEA重新索引项目。

我可以通过将IntelliJ(14.1.2)的Maven设置中的“Maven主目录”从“捆绑(Maven 3)”更改为“/usr/local/Cellar/ Maven /3.2.5/libexec”来解决这个问题。

我试了其他的答案,但是没有一个能帮我解决这个问题。

当我像这样显式地添加groupId时,问题就消失了:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
    </plugin>
</plugins>

一旦版本号的颜色从红色变为黑色,问题从Problems选项卡中消失,groupId可以再次从有问题的插件中删除,错误不再显示,版本号甚至显示为版本建议。