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


当前回答

我也有同样的问题,在检查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子模块中有两个略有不同的依赖项(版本2.1 vs 2.0)。在我切换到单一版本后,错误已经在IDEA 14中消失了。(刷新和。m2滑动没有帮助。)

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

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

我也有同样的问题。我将插件添加到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>

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

例如,如果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项目)

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

我的解决方案:

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

效果好极了!