当前位置: 首页 > 知识库问答 >
问题:

intelliJ中的Maven无法读取工件描述符-启用快照更新

公孙成仁
2023-03-14

上周,我的笔记本电脑更新到Windows 10。从那时起,intelliJ抛出了与Maven相关的错误,我一直无法解决。我所有的Maven插件都以红色突出显示,错误为:“未能读取(依赖)的工件描述符。”。这发生在每个插件和依赖项上。我还应该提到这是一个克隆项目,适用于其他所有人,所以问题不在于pom。

我已经尝试了很多方法来解决这个问题,包括:1。使缓存无效/重新启动2。重新导入项目3。重新导入Maven依赖项。4、删除intelliJ。iml和。idea文件夹。5.正在进行Maven clean安装(稍后将对此进行讨论)。6、进行git拉取并重新导入。安装外部Maven(最新版本),将其添加到环境变量和intelliJ中。

以下是我尝试运行时控制台的错误输出:

"C:\Program Files (x86)\Java\jdk1.8.0_31\jdk1.8.0_31\bin\java" "-Dmaven.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=**** "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.1.2 clean install
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for (redacted)
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 78, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building (redacted)SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.923s
[INFO] Finished at: Wed Jan 10 15:26:17 EST 2018
[INFO] Final Memory: 6M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Process finished with exit code 1

CMD Prompt尝试一个版本/clean/clean安装,我得到以下结果:

C:\Users\(redacted)\(redacted)\(redacted)>mvn clean
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for (redacted)-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 73, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building (redacted) 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.697 s
[INFO] Finished at: 2018-01-11T10:09:44-05:00
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

C:\Users\(redacted)\repos2\gpp-automated-testing>

最后,当我运行mvn clean-e以获取详细错误时,我会得到以下错误:

org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5

Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org

Caused by: org.apache.maven.wagon.TransferFailedException: repo.maven.apache.org

Caused by: java.net.UnknownHostException: repo.maven.apache.org

我尝试ping主机,我不确定这些是ping主机的正确方式,所以我尝试了所有。

C:\Users\(redacted)\repos2\(redacted)>ping http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Ping request could not find host http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Please check the name and try again.

C:\Users\(redacted)\repos2\(redacted)>ping http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Ping request could not find host http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Please check the name and try again.
C:\Users\(redacted)\repos2\(redacted)>ping http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/
Ping request could not find host http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/. Please check the name and try again.
C:\Users\(redacted)\repos2\(redacted)>ping http://repo.maven.apache.org
Ping request could not find host http://repo.maven.apache.org. Please check the name and try again.

共有2个答案

潘宝
2023-03-14

关于下面的警告

[WARNING] Some problems were encountered while building the effective
model for (redacted) 
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-
compiler-plugin is missing. @ line 78, column 21 [WARNING]  [WARNING] It is 
highly recommended to fix these problems because they threaten the stability 
of your build. [WARNING] 
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.

我想建议您使用目前3.7.0的最新版本的maven-compiler-plugin。对不起,我没有解决其余问题的方法。

 <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
  </plugin>
马庆
2023-03-14

好吧。。。你有DNS问题。。。这意味着逻辑名称:repo。专家阿帕奇。无法将组织转换为IP地址。。。这是您的操作系统和网络管理员的问题。。。所以你的pom和intellij很好。。。

更新:如果您有公司回购,则需要在您的中添加公司回购。平方米/设置。xml文件。。。在windows中,该文件夹位于用户系统文件夹中

 类似资料:
  • 问题内容: 我的Maven POM文件遇到问题,无法找到火花依赖关系,并返回错误:无法读取org.apache.spark:spark-streaming- kafka_2.10:jar:1.2.1的工件描述符 我已经确认这对任何公司防火墙都不是问题,因为其他所有依赖项都已正确加载,仅此一项。 我还能够在我的Maven设置中确认它正在尝试从以下存储库中提取。我尝试删除本地计算机上的.m2存储库以重

  • 所有基于idea的maven构建都失败了,每个maven依赖项都出现以下错误: “无法读取工件dependency:Coordinates”,其中“dependency:Coordinates”可能是POM中的任何依赖项。 Intellij Idea 14.0.2 Maven 3.2.3 jdk 1.7.0_71 由于我在公司网络上工作,我必须通过代理服务器访问外部世界。我已经将Intellij

  • 我还可以在我的maven设置中确认它正试图从以下回购中提取。我尝试删除本地机器上的.m2回购,以便重新加载它,但仍然没有骰子。 http://repo.maven.apache.org/maven2/org/apache/spark/spark-streaming-kafka2.10/1.2.1/ 下面是我的pom文件

  • 我正在使用最新的EclipseforJavaEE,并安装了JBoss工具,因此包含了Maven。我将一个现有的Maven项目导入到我的工作区,并尝试更新依赖项,但我只在POM中得到错误,即某些参数无效,并且无法传输任何工件。实际上有两种不同的错误,也许它们相互依赖?您可以检查:服务器可用,我还尝试重新安装Eclipse和JBoss。那么还缺少什么呢? 无法读取edu.kit.aifb.ai2.sq

  • 我想用spring boot和react js构建一个web应用程序(按照这里的教程)。在pom.xml中我添加了: 在执行mvn clean包时,我得到以下错误。Maven版本是3.0.5。

  • 当我运行“清洁安装”时,我会出现以下错误: Plugin org.apache.maven.plugins:maven-source-plugin:2.4或其依赖项之一无法解析:无法读取org.apache.maven.plugins的工件描述符:maven-source-plugin:jar:2.4:无法将工件org.apache.maven.Plugin:2.4from/to central(