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
Failed to Read Artifact Descriptor: IntelliJ
提问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 install
and 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 install
but 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选中该框,“始终更新快照”
回答by prime
Following worked for IDEA 17,
以下为 IDEA 17 工作,
- Go to
File
- Select
Settings
- Select
Build, Execution, Deployments
- Select
Build Tools
from drop down - Select
Maven
from drop down - Tick the
Always update snapshots
check 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 Tools
from drop down - Select
Maven
from 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
回答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.
就我而言,这是代理相关的问题。我重点强调了您可能需要验证和更正的几个方面。
- Intellij proxy settings from preference window
- maven settings.xml entry from your ~/.m2/settings.xml or /usr/local/Cellar/maven//libexec/conf/settings.xml
- System proxy
- 首选项窗口中的 Intellij 代理设置
- 来自您的 ~/.m2/settings.xml 或 /usr/local/Cellar/maven//libexec/conf/settings.xml 的 maven settings.xml 条目
- 系统代理
Hope this will help.
希望这会有所帮助。