IntelliJ IDEA does not show some files? Know the hiding-places

Have you ever found yourself in a situation when there is a file that exists on the disc but IntelliJ IDEA doesn’t show it anywhere? You press synchronize but nothing happens? OK, may be the next few tips will be helpful.

  • Check “Ignored files and folders” in File | Settings | File Types:
  • Check “Excluded roots” in File | Project Structure

Your files are shown in Project View but they are missed at runtime?

  • Check compilation patterns in File | Settings | Compiler
  • Check that they were not excluded from compilation in File | Settings | Compiler | Excludes

We hope that these simple tricks will save your time as well as ours. :)

This entry was posted in Tips & Tricks and tagged . Bookmark the permalink.

18 Responses to IntelliJ IDEA does not show some files? Know the hiding-places

  1. Geoffrey De Smet says:

    The default of compilation patterns in Intellij 10 is really bad (something like *.png;*.jpg;*.properties).
    It should really be changed to “!*.java” or what you’re showing there.

  2. Martin Knoller Stocker says:

    Can we use this to hide the intellij files like *.iml ;*.ipr or will that have a negative sideeffect?

  3. Thanks for your blog entry. However, the information given in this entry did not solve my problem, which is following:

    My test sources are located under a folder src/main/java/ (Yes, it is a Maven project). The sources are visible in the project view. When I try to run all tests of a project, Idea finds only two test classes and executes the tests found from them. The rest of my unit tests are ignored. I can run the tests from the ignored classes, if ran the tests by selecting only a single class and selecting ‘Run FooTest’. Maven executes all of my unit tests without problems.

    I am using IntelliJ Idea 10.0.3 and Maven 3.0.2. Any idea what could be wrong?

  4. Dmitry Kandalov says:

    One other catch I came across is that if file extension is not registered in “File Types” it won’t be included in “Find In Path” textual search. Not obvious if you don’t know about it.

  5. asuka says:

    Some files show but really slowly in IDEA, sometimes you need to reopen the filechooser so many times that they finally show, how do I handle it

  6. Anna Kozlova says:

    @Petri Could you please check how created junit/testng run configuration is configured. It may be a problem with classpath where tests are searched. Thank you

  7. Mark says:

    @Martin – I hide my .ipr, .iml, and .iws files and the .idea directory on the File | Settings | File Types screen. I find it saves hassles since searches don’t find things in settings files. And it reduces clutter in the project view. I’ve been doing it for 8 years and have never had an issue.

    My entry: …;*.ipr;*.iws;*.iml;.idea;

  8. @Anna, the test run configuration is following (I selected run all tests from the popup menu, which appears when I click the right mouse button on the project view):

    Test: All in package
    Search for tests: Across module dependencies
    Working directory: /Users/loke/Projects/Java/example
    Use classpath and JDK of module: example

    The rest of the fields are empty. I am running Idea on OS X 10.6.7. The weirdest thing about this problem is that it appeared between two test runs. In the first test run Idea could find all my test classes, but the second test run found only two test classes. The problem has been the same after that. Do you think that cleaning the caches of Idea could help?

  9. Anna Kozlova says:

    @Petri Actually I do not think so. Could you please send me e-mail/contact our support/file an issue in YouTrack, as this question seems to be specific to your set up and has nothing to do with this blog entry? Thank you

  10. @Anna, I contacted the support team as you suggested. Thank you for your help.

  11. Ryan says:

    It is very easy to exclude files by right-clicking and choosing exclude in the error dialog. It should be as easy to include them. Therefore, it would be very useful to have IntelliJ do two actions:

    1) When a make error occurs for a file that does exist but is included, a warning or note next to that error would be nice telling you that the compile failed due to the exclusion.

    2) Allow a user to right click on a file and exclude or include it for compilation.

  12. Andrew says:

    Hi Anna,

    Thanks for the helpful hints.

    Where do these config files get stored? I’ve looked everywhere and Xena seems to put them somewhere that previous versions didn’t.

    I tried to log on to YouTrack, but it seems to be down.

  13. Anna Kozlova says:

    Exclude folders are stored in corresponding .iml files; ecluded files from compilation and resource patterns are stored in compile.xml in .idea (or in .ipr file). Ignored file patterns are stored in filetypes.xml in your config directory.
    I hope that you do not need this information anyway ;)

  14. Ryan says:

    I would like Maven’s output dir to show in the project view so i can verify the contents of built artifacts, copy them to servers, etc. how do I get IntelliJ to stop automatically excluding the Maven output dir which is useful for development?

  15. Aydin O. Yagmur says:

    I can see the java source file in project scope, I can compile them if there is no package scoped source file, but when switch to package view I cannot see them.

    It’s really-really annoying.

  16. Lawrence says:

    @Mark:
    THANKS man! It’s old thread but I was looking for a way to hide *.iml etc. Your tip is worth gold. I do not get however why IntellJ sometimes does not show these files by default and sometimes it does! Gotta be me…

    Thanks man!

  17. Noah says:

    I’m having an odd situation where I have a project with a structure on disk like so:

    - project_root/
    – .idea/
    – module/
    – src/
    module.iml
    pom.xml

    When I open the project in IDEA (13 Cardea IU-130.555) the Project Files window shows the module as a top level folder, however, the .idea directory in the project root is no present. It looks something like this:

    -> module/
    -> src/
    module.iml
    pom.xml

    Is there a reason for this? How and I set things up so that the Profile Files view will include the .idea directory?

    Thanks,

    -Noah

  18. Noah says:

    It looks like I can’t edit my previous comment, but the formatting was not preserved in my last comment. The module/ and lines below it should have all been indented under -project_root/

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">