Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent IntelliJ from adding iml files

People also ask

Is it safe to delete IML file?

iml files have nothing to do with your code/Java. It is a hidden file created by Intellij on the root folder of your project which contains your module information. This is the reason you should not version this kind of file, afterall other developers using a different IDE won't need them.

What are .IML files in IntelliJ?

A module file (the . iml file) is used for keeping module configuration. Modules allow you to combine several technologies and frameworks in one application. In IntelliJ IDEA, you can create several modules for a project and each of them can be responsible for its own framework.

Are IML files auto generated?

iml because they get auto-generated in others Android Studio.

Where is IML file located IntelliJ?

iml files are all located in the root directory. I have problems running junit Tests which reads files, then it looks in the root dir instead of the module dir.


In case somebody else stumbles onto this issue, the best luck I've had is
Settings > Version Control > Ignored Files
Add "Ignore all Files Matching"s for:
*.idea
*.iml

Not sure which version of IDEA rolled out this functionality, and this question is somewhat old, so it may be moot. Just hope it helps somebody else out who landed here from Google as I did.


The latest version of IntelliJ Community prompts you for the iml file additions separately. If you check the box to avoid being warned in future and choose "no" the first time you are prompted, it will not schedule any further IML files for addition to subversion.


Elaborating on Colin Hebert answer. Yes, it is possible to move the iml file to another directory when importing from Maven. And this seem to be the only way to prevent this problem.

Here the settings to use in import:

enter image description here

Since all important informations are keep in Maven itself it only takes a little time to reimport an existing modules. The gain truly is worth it.


You can also choose to not have your .iml file in a versionned directory.

When you create the module, you can select the module file location. alt text

Here my iml file will be in /ModuleName.iml but the content will by in /myRoot/


If you want to disable checking in *.iml files across all projects, on the Mac OS X 10.8.x you can go to IntelliJ -> Preferences (Command-,) -> Version Control -> Ignore Files and set it up there. This is better if you are like me who works on many projects and frequently need to create/import new projects, I don't want to have to setup this pref on every individual project.