There’s just one small problem. It automatically creates a file in the module directory with the file extension
iml to store module-specific information. However, you don’t really want this file in the next Git commit, as it is only relevant for developers who also work with IntelliJ IDEA.
One way to prevent this would be to adjust the file
.gitignore accordingly. But this is not a very elegant solution because otherwise
.gitignore is quickly overloaded with restrictions that are only relevant for a specific IDE.
So here’s my tip for getting round this in a more elegant way.
I move the
iml file to the project directory and then change the file
modules.xml in the directory
.idea for the parameters
For those of you wanting a bit more meat on the bone here’s the steps in detail for the example project
my_project and the example module
- End IntelliJ IDEA.
- Move the file
my_project/my_module/xxx.imlto the directory
- Open the file
.idea/modules.xmlwith an editor.
- Write the changes back to the
- Start IntelliJ IDEA again.
This might look a bit complicated, but in fact it’s really quite easy and helps avoid any unwanted clutter in the Git repository.