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文件夹,使用“Invalidate Caches”和“Restart”,仔细检查POM文件中的插件声明,那么:

1. 检查IntelliJ Maven配置

Ctrl + Shift +一个 输入“Maven设置” 勾选“使用插件注册表” 再次检查“Maven主路径”和“用户设置文件” 尝试获取额外的日志:将“输出级别”设置为“调试”,然后单击“应用”

2. 检查IntelliJ Java配置

Ctrl + Shift +一个 输入“进口” 仔细检查“JDK for importer”中使用的JDK

3.更新cacerts keystore文件

请确保您信任远程Maven存储库的TLS服务器证书。为此,将公共证书添加到/path/to/jdk/jre/lib/security/下的cacerts密钥存储库(例如使用https://keystore-explorer.org/) -默认密码为“changeit”

如果你不能编辑文件:

Ctrl + Shift +一个 输入“进口” 更新“导入器的虚拟机选项”-Djavax.net.ssl.trustStore=/path/to/cacerts -Djavax.net.ssl.trustStorePassword=changeit然后单击“应用”

其他回答

对我来说,在settings.xml中有一个错误。我在url中使用http://,因为它不能工作。一旦我删除它,插件下载成功。

<proxy>
   <id>optional</id>
   <active>true</active>
   <protocol>http</protocol>
   <host>www-proxy.xxxx.com</host>
   <port>80</port>
  <!-- <nonProxyHosts>local.net</nonProxyHosts>-->
  </proxy>

  <!-- Proxy for HTTPS -->
  <proxy>
   <id>optional1</id>
   <active>true</active>
   <protocol>https</protocol>
   <host>www-proxy.xxxx.com</host>
   <port>80</port>
   <!--<nonProxyHosts>local.net</nonProxyHosts>-->
  </proxy>

我把依赖放在依赖项中,解决了我的问题:

<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.0.0</version>
    </dependency>
</dependencies>

我忽略了<pluginManagement>,它是<dependencyManagement>,这与<dependencies>不同:

dependencyManagement只声明依赖项,不引入依赖项。

因此,无论我清除存储库文件夹中的所有项目,还是键入mvn clean install -e -U,两者都不起作用。

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

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

我的情况:

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重新索引项目。