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


当前回答

对我来说,工作是把包含插件的存储库放在pluginRepository标签下。的例子,

<pluginRepositories>
    <pluginRepository>
        <id>pcentral</id>
        <name>pcentral</name>
        <url>https://repo1.maven.org/maven2</url>
    </pluginRepository>
</pluginRepositories>

其他回答

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

在我的例子中,在两个maven子模块中有两个略有不同的依赖项(版本2.1 vs 2.0)。在我切换到单一版本后,错误已经在IDEA 14中消失了。(刷新和。m2滑动没有帮助。)

我的情况:

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设置文件来摆脱它。然后我手动使用mvn命令更新Maven插件:

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

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

如果问题仍然存在,您可以手动添加丢失的插件文件。

例如,如果maven-site-plugins缺失,请访问https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-site-plugin

选择您的版本,并下载直接关联到您的。m2文件夹中的文件,在这个例子中:C:\Users\ {USERNAME} .m2\repository\org\apache\maven\plugins\maven-site-plugin\ {version}

在IntelliJ IDEA中,打开Maven侧栏并重新加载(工具提示:重新导入所有Maven项目)