英文:
IntelliJ IDEA is only showing External Libraries in the project window
问题
我正在使用IntelliJ IDEA 2023.1.2(社区版),如您在附图中所见,项目资源管理器只列出了External Libraries
。
我尝试过重新构建项目
、使缓存无效
以及从右侧面板的maven
菜单重新导入root pom.xml
,尝试运行mvn idea:idea
,但仍然没有列出项目文件。我该如何解决?
注:我有相当多的运行配置,因此除非有一种直接的方法可以将所有运行配置移动到新项目中(克隆到不同目录),否则删除整个项目并使用新的克隆不是一个选项。
英文:
I am using IntelliJ IDEA 2023.1.2 (Community Edition) and as you can see in the attached image, the project explorer only lists External Libraries
.
I tried Rebuilding the project
, Invalidate Caches
and reimporting the root pom.xml
from maven
menu at right side panel, tried running mvn idea:idea
, but still the projects files are not listed. How can I fix this?.
Note: I have quite a lot run configurations hence deleting the entire project and using a new clone is not an option unless there is a straight forward way to move all the run configurations to the new project (cloned to a different directory)
答案1
得分: 2
可能是项目导入时出现了问题。请逐步尝试以下故障排除步骤来解决它。
- 尝试清除
File | Invalidate Caches... | Invalidate and Restart
- 关闭项目窗口,位于
File | Close Project
,然后关闭 IntelliJ,尝试重新打开它。 - 在操作系统文件浏览器中打开项目,并删除所有
*.iml
文件以及项目中的.idea
文件夹。 - 从现有源重新导入项目到 IntelliJ,选择 pom.xml - https://www.jetbrains.com/help/idea/import-project-or-module-wizard.html
英文:
Probably there was an issue with the project import. Try the following troubleshooting steps one by one to address it.
- Try to clear
File | Invalidate Caches... | Invalidate and Restart
- Close the project window at
File | Close Project
and IntelliJ and try to reopen it. - Open your project in OS file explorer and remove all
*.iml
files and the.idea
folder from your project. - Re-import the project into IntelliJ from Existing sources by selecting pom.xml - https://www.jetbrains.com/help/idea/import-project-or-module-wizard.html
答案2
得分: 0
进入 文件 > 项目结构 > 模块(在项目设置下)。然后点击 "+ 添加内容根" 并选择您的项目目录。它将检测您项目中的 src 文件夹。
我用这种方法解决了我的问题,希望能对您有所帮助!
英文:
Go to File> Project Structure> Modules(under Project Settings). There click "+ Add Content Root" and select your project directory. It will detect src folder which resides in your project.
I have solved mine using this method, hope it helps!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论