.IPR and .IML files in source control

Hello, I am part of a team of programmers using IntelliJ on a large multimodular project.

We all want to share the same project and module structure, and when one of us changes that structure we all want to be synchronized.

We tried putting the .IPR and .IML files under source control, but that doesn't work--  IntelliJ modifies the files each time it opens them.  That means we are all constantly modifying these files and checking them in.

We can't be the first to have this problem.  What is the idiom for sharing IntelliJ files in a team?

Thanks in advance
Peter

0
8 comments
Avatar
Permanently deleted user

The solution is to use the (new) .idea directory project storage format rather than the .ipr file storage format. (It was added in either 8.0 or 8.1) You can select .idea (directory based) project structure when creating a project (.ipr is the default). Or you can convert a project using the Menu option "File -> Open in New (Directory Based) Format". Note that the name of this menu item has changed to "File | Save as Directory-Based Format..." in more recent Maia EAP (i.e. IDEA 9 early access program) builds.

More info is available in IDEA's help under the topic IntelliJ IDEA /  Concepts /  Project / Project Files

You can also take a look at this thread -- http://www.jetbrains.net/devnet/thread/279596?tstart=0 -- which discuss the topic. Towards the bottom is some info as to which files are meant to be stored in version control.

0
Avatar
Permanently deleted user

We've been storing IML and IPR files in a VCS since version 6 of IDEA and have never run into this problem - are you sure it isn't a custom plugin which is modifying the files?

0
Avatar
Permanently deleted user

For us it were different plug-ins. But it was a bad design, that it depends
on the plug-ins (which, of course, could be different in the same team) what
was written to the project files. Hence I welcome the directory based
project format which allows to cherry-pick the fragments to store under
version control (although a couple of them are still mixed, e.g. language
level is in .idea/misc.xml instead of the expected .idea/compiler.xml).

Tom

0
Avatar
Permanently deleted user

How would I find out if I plugin was touching my IML files?

What we see is that there is only whitespace changes (probably just the NL's).  This might be because some of us are on Linux, some on Mac and some on Windows.   But why would IntelliJ rewrite the file if nothing changed.

Thanks
P

0
Avatar
Permanently deleted user

What source control do you use?  You may need to force a new-line feed format onto the project files.

E.g. for Subversion, you can do this by using the svn:eol-style property.  See the Subversion manual for more info.


0
Avatar
Permanently deleted user

We have definietly run into this issue using SVN;

If we convert to the IDEA directory-structure based format, should we expect problems the next time a user syncs with these settings via SVN?  Or will each developer need to convert their individual project before getting an SVN update?


Thanks.

0
Avatar
Permanently deleted user

Thanks.

Yes, SVN has the problem that it does not know what .IPR and IML files are by default.  This causes it to mess with the newline character.  Adding the file types to ~/.subversion/config files this.

### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.
# *.c = svn:eol-style=native
# *.cpp = svn:eol-style=native
# *.h = svn:eol-style=native
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
# *.sh = svn:eol-style=native;svn:executable
# *.txt = svn:eol-style=native
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
# Makefile = svn:eol-style=native
*.iml = svn:eol-style=native
*.ipr = svn:eol-style=native
*.iws = svn:eol-style=native
*.xml = svn:eol-style=native


However, this does not explain why the files were touched in the first place.  Under what circumstances does does IntelliJ write out these files?  It seems to happen each time a project is opened, even if nothing is changed.  Is this correct?  Is there any control over when this happens?  Is it documented?

Thanks again
Peter

0
Avatar
Permanently deleted user

We work on Windows and sporadically on OS X, but don't had the described
problem with the project files. Are you sure that the line separators were
different on both systems?

0

Please sign in to leave a comment.