我对IntelliJ有问题。在左边的项目视图中没有显示任何文件夹。 我的设置是“查看为:项目” 我如何管理它,以便再次显示文件夹和包? 我什么都不知道,因为我没有改变任何选项!

我使用的是IntelliJ 10.0.3。 我正在做一个Maven升降机项目。


当前回答

这里的很多答案建议删除。idea。这对我来说只有50%的时间是有效的。简单的重新启动大约有10%的时间是有效的。作为一个模块重新添加东西是一个非常糟糕的hack,会导致其他问题,比如丢失一些项目专用设置。

我还发现了这个解决方法:

文件->修复IDE

右下角显示了一个对话框。点击“重新扫描项目索引”

当显示下一个对话框时,单击“重新打开项目”:

现在应该显示目录了。

其他回答

即使在5年之后,有了一些想法的经验,我仍然一直有这个问题。这是最简单的解决办法。

亲密的想法 删除.idea 启动Idea并打开项目,而不是导入项目

然后打开框架的conf文件,比如pom.xml或build。SBT或build。Gradle等,它会自动提示导入项目,当你点击它,当它完成时,你的项目基本设置正确。

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似乎是一个没有任何可见效果的选项卡选择,但它具有深远的影响,基本上是从构建过程中添加或删除文件。

因为我有同样的问题,上面没有一个对我有效,这就是我所做的!我知道这是一个暴躁的解决方案,但至少它最终起作用了!我不知道为什么只有这种方法有效。应该是我电脑里的某个奇怪缓存吧?

I did close IntelliJ I did completely remove the .idea folder from my project I did move the folder demo-project to demo-project-temp I did create a new empty folder demo-project I did open this empty folder with intelliJ I did move all the content demo-project-temp. Don't forget to also move the hidden files Press right click "Synchronize" to your project You should see all the files and folders now! Now you can also safely remove the folder demo-project-temp. If you are on linux or MAC do it with rmdir demo-project-temp just to make sure that your folder is empty

我尝试了上面所有的解决方案,没有一个有效。


Java-Maven项目

我的问题: 在我的情况下,我有java-maven项目。问题是Idea在默认情况下为项目(或您试图打开的任何人)使用它捆绑的maven。 我注意到捆绑maven会永远下载依赖项,也就是说你永远看不到你的sources文件夹。

解决方案: 因此,要配置它,需要配置Idea使用maven(mvn),默认情况下,所有项目都安装在机器上。 为了做到这一点,在一开始Idea还没有开放任何项目的时候……有一个配置按钮。他们选择了构建工具。然后是maven,在那里你会看到下拉列表,你可以选择本地maven。 简而言之:配置/构建工具/Maven/下拉菜单 (我的操作系统:linux分支)

希望这能有所帮助

项目结构=>模块=>选择你的模块=>路径=>确保选择了“继承项目编译输出路径”