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

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

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

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

这对我来说很管用……删除“C:\Users[Windows用户帐户].m2\repository”下的所有文件夹和文件。

最后在IntelliJ的Maven项目选项卡中运行“重新导入所有Maven项目”。

如果你在Maven插件的项目下面有红色的涂鸦,试着点击“重新导入所有Maven项目”按钮(看起来像一个刷新符号)。

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

取消选中Maven设置中的“脱机工作”复选框。

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

Goto intelligent -> Preferences ->插件

搜索maven,你会看到 1. Maven集成 2. Maven集成扩展。

选择Maven Integration选项并重新启动Intellij

其他的答案都对我没用。对我来说有效的解决方案是通过cmd手动下载丢失的工件:

mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=ro.isdc.wro4j:wro4j-maven-plugin:1.8.0

在此更改之后,需要让Idea了解新的可用工件。这可以在“设置> Maven >存储库”中完成,选择那里的“本地”,然后简单地单击“更新”。

编辑:-DrepoUrl似乎已弃用。- dremoterepository应该用。来源:Apache Maven依赖插件-依赖:获得。

我也有同样的问题。我将插件添加到pom.xml依赖项中,它为我工作。

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
        <type>maven-plugin</type>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <type>maven-plugin</type>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <type>maven-plugin</type>
    </dependency>

我最近也遇到了同样的问题。其他解决方案都无法解决红色错误线。

我所做的就是运行实际的目标(部署、站点)。我可以看到这些依赖关系被获取。

在那之后,重新导入成功了。

如果工件无法解决。 进入.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)可以重新加载丢失的内容。

多年来,我在使用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设置中,我已经将Maven主目录从捆扎(Maven 3)更改为捆扎(Maven 2)。这对我很有用。试试看!

红色警告maven-site-plugin在构建站点生命周期后解决:

我的IntelliJ版本是Community 2017.2.4

删除本地Maven未知插件并重新导入所有Maven项目。这将解决这个问题。

你可以在View > Tool Windows > Maven下找到它:

IntelliJ IDEA和Maven -“未解决的插件”解决方案”-特别是删除插件文件夹-然后在ide重启后重新导入所有Maven插件-对我有用。

我正在使用IntelliJ Ultimate 2018.2.6,并发现,功能重新导入所有Maven项目不使用JDK,这是在设置中设置的:构建,执行,部署|构建工具| Maven | Runner。 相反,默认情况下它使用IntelliJ_HOME/jre64/中自己的JRE。您可以在“构建,执行,部署|构建工具| Maven |导入”中配置导入器的JDK。

在我的特定问题中,JREs密钥存储库中缺少SSL证书。不幸的是,IDEA只在自己的日志文件中记录这个问题。一个小红框来通知RuntimeException真的很好……

这可能会帮助到某个人

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

这招对我很管用:

亲密的想法 删除“*。我“而且”。Idea " -目录(存在于项目的根文件夹中) 从命令行运行“mvn clean install” 将您的项目重新导入IDEA

重新导入整个项目后,依赖项的安装将开始,这将需要几分钟完成,这取决于您的互联网连接。

你可以将它们作为依赖项添加:

<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
    </dependency>
</dependencies>

Intellij将解决这些问题。成功导入依赖项后,可以清除它们。

对我来说,在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>

以下是我试图解决这个问题的方法,它奏效了:

从.m2 repo中手动删除现有插件 在IntelliJ中启用“使用插件注册表” 使缓存无效并重新启动IntelliJ 在IntelliJ中重新导入maven项目

在执行上述步骤后,问题得到了修复。希望这对你也有帮助。

解决了! !

这就是我解决问题的方法……

Tried one of the answers which include 'could solve it by enabling "use plugin registry" '. Did enable that but no luck. Tried again one of the answers in the thread which says 'If that does not work, Invalidate your caches (File > Invalidate caches) and restart.' Did that but again no luck. Tried These options .. Go to Settings --> Maven --> Importing and made sure the following was selected Import Maven projects automatically Create IDEA modules for aggregator projects Keep source... Exclude build dir... Use Maven output... Generated souces folders: "detect automatically" Phase to be...: "process-resources" Automatically download: "sources" & "documentation" Use Maven3 to import project VM options for importer: -Xmx512m But again no success. Now lets say I had 10 such plugins which didn't get resolve and among them the first was 'org.apache.maven.plugins:maven-site-plugin' I went to '.m2/repository/org/apache/maven/plugins/' and deleted the directory 'maven-site-plugin' and did a maven reimport again. Guess what, particular missing plugin got dowloaded. And I just followed similar steps for other missing plugins and all got resolved.

对我来说,我手动下载它们,把主题放在我的。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-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项目)

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

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

我也有同样的问题,在检查pom.xml文件后,发现我有重复的插件。删除后,在pom.xml中只留下1 -问题解决。

还有maven-surefire-report-plugin == LATEST 而且

     <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.9.8</version>
    </dependency>

对我来说,插件是与概要文件相关的。 我必须通过Maven(右侧栏菜单)启用相关的配置文件,配置文件并让依赖项下载。

检查找不到的插件(maven-site-plugin,maven-resources-plugin) 转到"。m2/repository/org/apache/maven/plugins/ " 删除目录rm -rf plugin-directory-name(例如:rm -rf maven-site-plugin) 从intellij退出项目 重新导入项目 是否重新导入Maven

解释:当你重新导入maven时,它会再次下载所有丢失的插件。

快乐的编码

启用“使用插件注册表”和重新启动项目后无效现金解决了我的问题

到“启用“使用插件注册表”>>> (intelij) File >设置> Maven >从Maven选项列表中启用该选项

使现金>>>文件>失效

就是这样……

尝试了无效缓存,重新导入项目,部分和整体删除.m2文件夹,并切换到Idea捆绑的Maven。 没有任何工作,我最终完全破坏了Maven:当它在控制台中构建项目时,现在它停止了。 不得不重新安装Maven,它帮了大忙!

对我来说,这就像给插件一个版本一样简单:

<version>3.3.0</version>

完整的插件代码示例如下:

<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>3.3.0</version>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
        <configuration>
          <archive>
            <manifest>
              <mainClass>Main</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </execution>
    </executions>
  </plugin>

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

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

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

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

尝试将以下代码放入pom.xml中。如果这不起作用,尝试更改<version>2.8.2</version>(可以在maven repo中找到不同的版本)。

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

我的情况:

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.

就我而言,我尝试了上面的大部分答案。我解决这个问题的方法是:

清理.m2/repository文件夹中的所有项目 卸载Intellij终极版本 安装社区版本

它如此神奇地有效!

最近我也遇到了同样的问题。 所有的建议对我的事业都不起作用。

但我把它修好了。

转到Intellij idea设置,找到Maven,在其中打开Repository选项卡并更新Maven和本地repos。这是所有。

我只是删除了我所有的maven插件存储在。m2\repository\org\apache\maven\plugins, IntelliJ再次下载了所有的插件,它解决了我的问题,它为我工作得很好!!

这对我很有效

进入设置—> Maven—>导入—>导入器的JDK—> 使用“使用项目JDK”选项,而不是之前的自定义JDK集。 重新构建/重新导入所有依赖项。

这些方法对我来说都没用。在经历了痛苦的几个小时后,我发现这个问题是由我导入项目的方式引起的。

上下文:导入带有Web和Kafka依赖项的新生成的Spring Initializr项目。

问题:插件依赖“未找到”,IntelliJ无法编译应用程序,即使mvn清洁编译在控制台上运行良好。

坏的方法:使用“New > Project from Existing Sources…”选项导入它。

好的方法是:使用“Open…”选项导入它。

从坏到好的解决方案:删除项目,从版本控制中删除并重新克隆repo,以确保所有gitignored IntelliJ文件都被删除,并使用“Open…”选项将其导入IntelliJ。

我使用的是Ubuntu 18.04中打包为snap的社区版。

每次IntelliJ发布时,我都会遇到这个问题。

在该场景中,我的工作解决方案是调用invalidate缓存,并从标记索引删除的文件menù重新启动。

6月/ 2021:

不删除,不重新导入。

我所做的就是:

C:\Users\dell\.m2\repository\org\apache\maven\plugins

然后双击每个插件文件夹,并查看下载的版本。

然后我回到pom文件,根据下载的版本,我在<version>....中仔细修改了那些版本> < /版本标签。然后刷新。

这样,所有的红色标记都消失了,甚至那些黄色标记也消失了。

所有的清洁。

这是我完整的pom文件,以备进一步通知。该项目是JavaFx+Maven与阴影:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>main.java.sample</groupId>
    <artifactId>ThreeColumnTable</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>15.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>15.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.4</version>
            <type>maven-plugin</type>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.7</version>
            <type>maven-plugin</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>resources</goal>
                            <goal>testResources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.1.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/generated-groovy-stubs</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.example.App</mainClass>
                            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.1</version>
                <configuration>
                    <mainClass>org.example.App</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>project-classifier</shadedClassifierName>
                            <transformers>
                                <transformer implementation=
                                                     "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>org.example.Main</mainClass>
                                </transformer>
                            </transformers>

                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

其他的解决方法对我都不起作用。

我的解决方案:

Maven设置->存储库->在列表中选择“本地存储库”,单击“更新”

效果好极了!

必须添加依赖项

这个问题很老了,但我希望我的答案能帮助那些找到它的人

参考 (链接) https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin/3.1.1

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>3.1.1</version>
</dependency>

从下面删除所有文件夹,并执行“重新加载所有Maven项目”刷新按钮,这对我来说很有效。

C:\Users\<username>\.m2\repository\org\apache\maven\plugins

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

<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,两者都不起作用。

如果你已经尝试清除你的.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然后单击“应用”