简体   繁体   English

无法解决 IntelliJ 中的 Maven 依赖项

[英]Not able to resolve Maven dependencies in IntelliJ

I am working on a project using Maven dependencies.我正在使用 Maven 依赖项进行项目。 But, I am not able to get it resolved in IntelliJ or in other words, IntelliJ shows red in import.但是,我无法在 IntelliJ 中解决它,或者换句话说,IntelliJ 在导入时显示为红色。 Is there any extra configuration required?是否需要任何额外的配置?

Below is how my IntelliJ Maven configuration looks like -下面是我的 IntelliJ Maven 配置的样子 -

在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

In command line, Maven version I see is -在命令行中,我看到的 Maven 版本是 -

WFORealtimePassThroughLambda % mvn --version Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /usr/local/Cellar/maven/3.8.6/libexec Java version: 18.0.2.1, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/18.0.2.1/libexec/openjdk.jdk/Contents/Home Default locale: en_IN, platform encoding: UTF-8 OS name: "mac os x", version: "12.5.1", arch: "x86_64", family: "mac" WFORealtimePassThroughLambda % mvn --version Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /usr/local/Cellar/maven/3.8.6/libexec Java version: 18.0.2.1, vendor: Homebrew, runtime: /usr/local/Cellar /openjdk/18.0.2.1/libexec/openjdk.jdk/Contents/Home 默认语言环境:en_IN,平台编码:UTF-8 操作系统名称:“mac os x”,版本:“12.5.1”,arch:“x86_64”,系列: “苹果电脑”

None of the solution available on internet worked for me.互联网上可用的解决方案都不适合我。 Finally, I had to delete the workspace and created it again.最后,我不得不删除工作区并重新创建它。 In IntelliJ, on opening for the first time, it was prompting "Download pre-built shared indexes" at right bottom corner, I clicked on it, which seem to download all Maven dependencies.在IntelliJ中,第一次打开时,右下角提示“下载预建共享索引”,我点击它,似乎下载了所有Maven依赖项。 After that, all dependencies got resolved.在那之后,所有的依赖都得到了解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM