Java 无法读取工件描述符:IntelliJ

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35105667/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 16:18:27  来源:igfitidea点击:

Failed to Read Artifact Descriptor: IntelliJ

javamavenintellij-ideaapache-sparkapache-kafka

提问by user2100493

I am running into an issue with my Maven POM file where its unable to find spark dependency and is returning with error: Failed to read artifact descriptor for org.apache.spark:spark-streaming-kafka_2.10:jar:1.2.1

我的 Maven POM 文件遇到了一个问题,它无法找到 spark 依赖项并返回错误:无法读取 org.apache.spark:spark-streaming-kafka_2.10:jar:1.2.1 的工件描述符

I've confirmed its not an issue with any corporate firewall as every other dependency is loaded in properly, just this one.

我已经确认它不是任何公司防火墙的问题,因为所有其他依赖项都已正确加载,仅此一项。

I have also been able to confirm in my maven settings it is attempting to pull from the following repo. I tried deleting the .m2 repo on my local machine in order to reload it, still no dice.

我还能够在我的 Maven 设置中确认它正在尝试从以下存储库中提取。我尝试删除本地机器上的 .m2 存储库以重新加载它,但仍然没有骰子。

http://repo.maven.apache.org/maven2/org/apache/spark/spark-streaming-kafka_2.10/1.2.1/

http://repo.maven.apache.org/maven2/org/apache/spark/spark-streaming-kafka_2.10/1.2.1/

Attached below is my pom file

下面附上我的pom文件

<groupId>my.group.id</groupId>
<artifactId>sentiment</artifactId>
<version>1.0-SNAPSHOT</version>
<name>NPITWITTER</name>

<properties>
</properties>

    <dependencies>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming-kafka_2.10</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.10</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_2.10</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-hive_2.10</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_2.10</artifactId>
            <version>1.2.1</version>
        </dependency>


    </dependencies>

采纳答案by user2100493

Resolved it, was due to a proxy setting that was enabled. Re-ran with mvn -U clean installand all was repaired.

解决了,是由于启用了代理设置。重新运行,mvn -U clean install一切都被修复了。

回答by Raju

In Intellij, I had the same issue,

在 Intellij 中,我遇到了同样的问题,

I did the proxy settings also, and ran the command mvn –U clean installbut it's not working.

我也做了代理设置,并运行了命令,mvn –U clean install但它不起作用。

I got its resolved with the below setting enabled (highlighted in yellow)

我通过启用以下设置解决了它(以黄色突出显示)

In Intellij, go to File-> Settings-> Build, Execution, Deployments-> MavenCheck the box, ‘Always update snapshots'

在 Intellij 中,转到文件->设置->构建、执行、部署-> Maven选中该框,“始终更新快照

Intellij Settings window snapshot

Intellij 设置窗口快照

回答by prime

Following worked for IDEA 17,

以下为 IDEA 17 工作,

  • Go to File
  • Select Settings
  • Select Build, Execution, Deployments
  • Select Build Toolsfrom drop down
  • Select Mavenfrom drop down
  • Tick the Always update snapshotscheck box
  • File
  • 选择 Settings
  • 选择 Build, Execution, Deployments
  • Build Tools从下拉菜单中选择
  • Maven从下拉菜单中选择
  • 勾选Always update snapshots复选框

回答by Sandoval0992

I guess IntelliJ comes with and ambedded Maven installation, so just make sure your IDE is pointing to the right Maven home directory:and User settings file:values, these are under:

我猜 IntelliJ 带有嵌入式 Maven 安装,所以只需确保您的 IDE 指向正确的Maven 主目录:用户设置文件:值,这些位于:

  • Go to File
  • Select Settings
  • Select Build, Execution, Deployments
  • Select Build Toolsfrom drop down
  • Select Mavenfrom drop down
  • File
  • 选择 Settings
  • 选择 Build, Execution, Deployments
  • Build Tools从下拉菜单中选择
  • Maven从下拉菜单中选择

回答by alexandru catanet

Go to file => Settings => Build, Execution, Deployment => Maven => Maven home directory: change from Bundled (Maven 3) to Bundled (Maven 2)

转到文件 => 设置 => 构建、执行、部署 => Maven => Maven 主目录:从 Bundled (Maven 3) 更改为Bundled (Maven 2)

回答by Chaklader Asfak Arefe

I had to just solve the issue. Please, go in the Maven tab of the Build, Execution, Deploymentsand set to the settings provided.

我不得不解决这个问题。请进入 Maven 选项卡Build, Execution, Deployments并设置为提供的设置。

enter image description here

在此处输入图片说明

回答by Dhrubo

In my case, it was proxy related problem. I am highlighting few of areas where you may need to verify and correct the same.

就我而言,这是代理相关的问题。我重点强调了您可能需要验证和更正的几个方面。

  1. Intellij proxy settings from preference window
  2. maven settings.xml entry from your ~/.m2/settings.xml or /usr/local/Cellar/maven//libexec/conf/settings.xml
  3. System proxy
  1. 首选项窗口中的 Intellij 代理设置
  2. 来自您的 ~/.m2/settings.xml 或 /usr/local/Cellar/maven//libexec/conf/settings.xml 的 maven settings.xml 条目
  3. 系统代理

Hope this will help.

希望这会有所帮助。