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


当前回答

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

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

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

其他回答

如果工件无法解决。 进入.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设置中,我已经将Maven主目录从捆扎(Maven 3)更改为捆扎(Maven 2)。这对我很有用。试试看!

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

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

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

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

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