File-based vs Directory-based Projects. Which way to go? Follow
IntelliJ noob here. I'm just wanting to find out why there are these two different approaches to managing projects, what the relative merits are, and why, in particular, IntelliJ defaults to the directory-based option when creating a new project (That's what appears to happen when I create a new project using the wizard). I come from a VS background so I'm used to file-based solutions and projects, and in some sense I feel more secure with that...like it's more tightly managed and controlled. Directory-based management seems "loose" to me and prone to integrity cock up, but I'm happy to be shown wrong. I would like to know what the more popular approach is in the IntelliJ and OSS communities.
Thanks in advance.
Please sign in to leave a comment.
Directory based format is preferred, we have plans to deprecate the file based format at some point.
Short and sweet. Thanks! :)
Just in case you you're interested in why .idea is preferred to *.ipr, here is the main difference - there is a number of settings relevant to particular user (e.g. whether to show line numbers in editor). All that 'local settings' are stored in *.ipr, hence, it shows conflicts if stored in vcs.
However, you can store only relevant .idea files in vcs (files which hold 'shared project settings'), so, there are no vcs conflicts for the ide config.
Ah ok. I assume some of the xml files in .idea also contain local settings though (e.g. workspace)? How does IDEA know to exclude these from commits?
Yes, .idea directory contains 'local settings' files as well, and it's up to end-user to decide what files should be kept and synced via vcs
I see. Which of the xml files contain local settings in .idea?
See https://intellij-support.jetbrains.com/entries/23393067 .
OK. Thanks Serge and Denis for your help.
@Serge: If you deprecate file based projects, please fix the directory based projects first that they are *completely relative* to their project folder, and can be copied around and still keep on working, just like file based projects now. Thanks in advance. :)
Directory based projects should work exactly the same as the file based in terms of using the relative paths where possible. If it doesn't work for you, please report a bug with more details: https://youtrack.jetbrains.com/newIssue?project=IDEA .
Thanks for your answer.
I've tried to reproduce the error I got earlier with a simple new project, but could not.
I now suspect the error was caused by some Gradle configuration in the original project, now removed.
When I use only IntelliJ projects it works fine indeed.