There's a bug in IDEAs project creation wizard.

(in IDEA 12.1.3) I notice that when creating a File > New Project > Java Module, then there is different behaviour if I type the module name in first, followed by the project name, as opposed to when I do the opposite.

In the first case the module file path in .idea/modules.xml becomes

<module fileurl="file://$PROJECT_DIR$/moduleFirst.iml" filepath="$PROJECT_DIR$/moduleFirst.iml" />

The latter case becomes

  <module fileurl="file://$PROJECT_DIR$/ModuleLast/ModuleLast.iml" filepath="$PROJECT_DIR$/ModuleLast/ModuleLast.iml" />

Now the project structure of the last case (Project First, Module last) makes most sense (see screenshot), but it appears a bit unfortunate that the .idea file isn't immediately visible in IDEA's project browser (see screenshot), like it is in the first case where it's path gets set to the same as that of the module.

Is this a bug?  Am I meant to manually add the .idea folder to the project's files?

Screen Shot 2013-05-12 at 8.41.47 PM.png
Screen Shot 2013-05-12 at 8.29.26 PM.png

.idea folder should be under a module content root to make it possible to share project settings via source control.
So, the secong case exposes a bug.


Thank you for having at look at it.  I'll file it to YouTrack

What about the .idea folder. Will I ever want that to be visible from the Project Tool Window for any reason? (and what would that reason be? I mean, what would the use case be for viewing/editing the contents of the .idea folder?)



.idea folder should be visible in Project View if it is located under content root.


That makes it clear. Thank you.


Sorry, I was wrong. .idea does contain internal internal settings, but since it can be shared via source control, it should be located under content root (and be visible in project view).
So, the bug is in the first case (editing project name first). I will correct the wrong answers above.


hmm .. while this gets the .idea folder into the Project Tool Window (by virtue of being under the content root of the default module), It also breaks the hiearachical seperation of a Project being composed of modules, doesn't it? If the .idea folder literally is part of the initial default module in this way, doesn't that blur two otherwise separate concepts - project and module?


Yes this is a known problem of multi-module projects in IDEA. Usually top
module contains others, as it happens for maven-based projects. You can
organize it in other way, but since you can have content roots on module
level only, conceptual problem remains.


Please sign in to leave a comment.