IntelliJ files (.iml .ipr etc.) and Source Control
Hello again,
I am looking for a document, advice and/or good practice.
I have a team of people using IntelliJ and SVN. When one of us fixes a bug in their IntelliJ project (e.g. add a missing dependency) I want the team to inherit that fix. I want the team to be working on "the same" project.
However, we have been having a terrible time trying to share our IntelliJ files. IntelliJ always seems to be altering the .iml and .ipri files every time a project is used. We are constantly trying to decide if we should use the new version in source control, or keep our local version which is working at the moment.
How should a team of people use IntelliJ? Is there a document that describes good practice? What do other teams do?
I know we are not the first
Thanks
Peter
Please sign in to leave a comment.
Hello Peter,
The .ipr and .iml files are definitely supposed to be stored in version control.
If you have unexpected changes, please attach diffs and we'll see what we
can do to avoid them.
To avoid merge conflicts in project files, it also helps to use the new directory-based
project format introduced in IDEA 8.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Completely agree, you must use the new .idea structure which totally avoids complex merges.
Hi,
FWIW, I recently switched to a .idea based project. There are a couple of things to keep in mind before switching:
1- Don't use 8.1.3 because a regression causes the .svn directory inside the .idea directory to be blown away and cause a bunch of problems. All your developers have to be on 8.1.4 EAP at the very least. (9920 or better)
2- When you setup the project, it by default ignores the workspace.xml file. It does that for good reason. If you add it to svn, then everyone's workspace will be shared and that's not a good thing. IDEA has a few facilities to share some of the run targets like jboss etc... by simply clicking a share this with other check box in each settings window. That creates new .xml files so that will be carried around without the need to share the workspace.
I find the .idea method to work incredibly well. If we didn't have the 8.1.3 bugs to deal with, it would have been an incredibly smooth migration. now that the whole team is on it, things move quick, changes happen quickly and not only that, but if a module changes, you don't have to reload the whole project; you update and boom everything falls into place and you can keep working.
Good stuff. Highly recommend it. In fact I don't know why you'd use the 'old' way.
R
I am using starteam integration and intellij is putting work-related specific information in the .ipr file. Every time I schedule a file or directory to be added, this informatoin is stored in the project file. It has nothing to do with the project structure or settings, it's just work that I am doing that is being stored there. Intellij is constantly asking me if I want to reload the project because the .ipr file keeps changing.
Here is an example of an entry I would expect to see in a working directory rather than the project file:
<component name="StarteamVcsAdapter">
<StarbasePersistencyNewFile>$PROJECT_DIR$/../some/directory/test/config/file.txt</StarbasePersistencyNewFile>
<StarbasePersistencyNewFile>$PROJECT_DIR$/../some/directory/test/config/directory</StarbasePersistencyNewFile>
</component>
Hi,
I have this problem in a project created with the newest IDEA that was available in early 2016. It uses the .idea directory format. Now I'm running 2016.2.5 with java 1.8.0_101 and it still occurs. Please note that our team has slightly different versions of IDEA and Java8 running, but still at most half a year of difference.
My project os a maven java project producing a .war file, and the .iml file looks like this:
The problem I am occasionally running into is that I get a diff for this file that reorganizes most of the maven-provided <orderEntry> elements in the file. It even happens even if no versions actually change (verified by sorting the list of entries).
In the .idea directory there is a .idea/artifacts/myproject_war_exploded.xml:
Is it perhaps so that IDEA honors the order of deps, but maven doesn't and gives them in some unpredictable order? If so, perhaps the maven deps could just be sorted alphabetically?