我刚刚从subversion导入了一个项目到IntelliJ IDEA 11——这是一个maven项目。但是我在maven库依赖关系中有一个问题,所以我不能自动包括所有maven依赖关系- IDEA只在我打开该类时显示依赖错误/这就是我在这里得到的:

所以我想要自动添加所有依赖项-这是可能的还是我必须遍历所有类文件来识别和添加maven依赖项?!

更新:在做了一些修改之后,我发现了如何以某种方式解决我的问题。我就是这么做的:

但我认为从逻辑上讲,它不会包括和检查新的依赖关系?!在intelliJ - auto export dependencies to classpath中是否有设置区域?


当前回答

我遇到了同样的问题,尝试了这里提到的所有答案,没有一个有效。

简单的解决方案是到你的项目文件夹,删除所有的。idea和。iml文件,并重新启动IntelliJ ide。它的工作原理。不需要对设置做任何操作。

其他回答

重新导入maven -> close-intellij ->删除全部 -。Idea-folder ->重新打开项目-> build- > build-project/build-module-'your parent module'

From maven tab click + and choose pom.xml From maven tab click download sources and documentation On project structure(where you can view project files/directories) right click the project you're trying to build and choose Build Module Project Name. From tab Run- Edit Configurations with + add Application and fill the below fields: i. Main Class- Manually choose from Project tab select the main class ii. Use classpath of module - choose the application name iii. Shorten command line - classpath file Now simply run the app.

帮助我的是:

Navigage: |构建、执行、部署| Maven

指定“Maven主目录”——安装Maven的位置

3.3 IntelliJ 2020年。

这一个帮我做到了。

构建、执行、部署工具。

更改“在构建脚本中更改后重新加载项目”:

从默认的“外部更改”改为“任何更改”

有了这个,重建项目花了一段时间,但现在我可以看到IntelliJ中的Maven依赖项:

我通过使用正确的镜像配置更新我的settings.xml文件解决了这个问题,似乎每次导入maven模块时,intellij都会尝试从存储库下载元数据。