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


当前回答

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

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

其他回答

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

这可能会帮助到某个人

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

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

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

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

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

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