我对IntelliJ有问题。在左边的项目视图中没有显示任何文件夹。 我的设置是“查看为:项目” 我如何管理它,以便再次显示文件夹和包? 我什么都不知道,因为我没有改变任何选项!
我使用的是IntelliJ 10.0.3。 我正在做一个Maven升降机项目。
我对IntelliJ有问题。在左边的项目视图中没有显示任何文件夹。 我的设置是“查看为:项目” 我如何管理它,以便再次显示文件夹和包? 我什么都不知道,因为我没有改变任何选项!
我使用的是IntelliJ 10.0.3。 我正在做一个Maven升降机项目。
当前回答
将“Project”下拉菜单改为“Project Files”
我知道这并没有回答涉及Maven模块的OPs问题,但这是截至2021年7月谷歌上的第一个搜索结果,当时试图调试为什么文件夹在IntelliJ中不能正确显示
其他回答
我尝试了上面所有的解决方案,没有一个有效。
Java-Maven项目
我的问题: 在我的情况下,我有java-maven项目。问题是Idea在默认情况下为项目(或您试图打开的任何人)使用它捆绑的maven。 我注意到捆绑maven会永远下载依赖项,也就是说你永远看不到你的sources文件夹。
解决方案: 因此,要配置它,需要配置Idea使用maven(mvn),默认情况下,所有项目都安装在机器上。 为了做到这一点,在一开始Idea还没有开放任何项目的时候……有一个配置按钮。他们选择了构建工具。然后是maven,在那里你会看到下拉列表,你可以选择本地maven。 简而言之:配置/构建工具/Maven/下拉菜单 (我的操作系统:linux分支)
希望这能有所帮助
I have a better solution that worked for me and it might work for you. No need to delete the whole .idea folder as this way you lose the whole project. It is possible that you just accidentally excluded all folders in project settings. I also found that project folders disappeared. I was trying to find out how to disable indexing, so I was looking at Project Settings -> Modules and I clicked on Excluded to see if I could add the whole project there to ignore it for indexing. It didn't do anything and I couldn't drag and drop the folder under Excluded. What I didn't realize is that simply clicking "Excluded", IntelliJ automatically moves the folder to Excluded and all folders disappeared in Project Explorer. "Excluded" button changes background to gray, which means exclusion is active. This is a very poor user interface because it is hardly noticeable and clicking this button has a far-reaching impact on your project.
Fix:
打开项目设置->模块 如果“排除”突出显示,单击它 单击应用或关闭
结果: 项目中的文件夹再次显示出来
非常糟糕的UI设计!源和排除按钮看起来像标签时,他们的工作实际上是“复选框”!
注意,仅仅单击Sources或Excluded似乎是一个没有任何可见效果的选项卡选择,但它具有深远的影响,基本上是从构建过程中添加或删除文件。
我是IntelliJ IDEA 2016.2的新用户。当我第一次运行该程序时,我打开了一个现有的项目,并且有相同的问题,其中它只显示根目录中的文件在1。项目面板,而不是项目文件夹(可展开的树状结构)。
最初,我尝试去项目设置>模块,那里没有显示列出的模块。我点击(+),并试图选择我的根文件夹,但它不会选择文件夹。
所以我用以下步骤来解决这个问题:
Exit IntelliJ Delete the existing .idea folder (i.e. rm -rf .idea) Restart IntelliJ Verified that the project root folder now appeared (in Project Settings > Modules) Toggle On the toolbar buttons (i.e. 1. Project Structure) to display on the left sidebar (clicked View > Toolbar Buttons until tick appears) Click 1. Project Structure toolbar button until its sidebar is revealed Click the arrow icon on the left of your project's root directory name that appears to expand the tree folder structure
2017年9月2日更新:如果你已经添加了一个模块SDK,并且它在你的项目根目录的子目录中添加了一个。iml文件,这导致它加载模块子目录,那么你可能需要修改这个。iml文件,通过追加/..如下图所示。
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/..">
我已经删除了。idea文件夹。关闭ItelliJ并重新启动以打开相同的项目。
它要求添加内容根。这对我很管用。
删除.idea/workspace.xml对我有用。关闭项目,删除.idea/workspace.xml,然后重新打开项目。我使用的是2019.1版本。