Intellij vs. subversion + maven

I am working on a multi-module Intellij project that uses maven and subversion. These don't go well together.

The module files are generated from the maven pom.xml files. Because they are generated, we don't want to check them into subversion. But Intellij insists on placing these files in the source hierarchy.

svn:ignore is a pretty poor solution for us because we have many modules (probably more than we should). Using svn -R propset to ignore iml files does an OVERWRITE of svn:ignore, causing other ignores to be lost.

What I'd really like is the ability to keep the iml files out of the source hierarchy. Is there a way to do this? If not, I think there should be. I'm a longtime Intellij user, and it used to be possible (Version 6? Maybe before that) to specify different directories for project files and sources.

Jack Orenstein

4 comments
Comment actions Permalink

The ignore property is the way to do it. You can set the ignore property through IntelliJ which will solve the overwrite problem as intellij offers a dialog to add to the existing properties.

Also, you may want to look at propedit which does the same thing from the command-line. Do this at the top-level of your project:

svn propedit svn:ignore .

It will open an external editor (vi, emacs, or whatever appropriate for your platform) that lets you append to the current properties.

0
Comment actions Permalink

Hello Jack,

You can store the .iml files anywhere on the disk, by specifying different
options in "Content root" and "Module file location" fields when creating
a new module. However, the Maven integration doesn't have an option of placing
the .iml files in a non-default location when performing the import.

I am working on a multi-module Intellij project that uses maven and
subversion. These don't go well together.

The module files are generated from the maven pom.xml files. Because
they are generated, we don't want to check them into subversion. But
Intellij insists on placing these files in the source hierarchy.

svn:ignore is a pretty poor solution for us because we have many
modules (probably more than we should). Using svn -R propset to ignore
iml files does an OVERWRITE of svn:ignore, causing other ignores to be
lost.

What I'd really like is the ability to keep the iml files out of the
source hierarchy. Is there a way to do this? If not, I think there
should be. I'm a longtime Intellij user, and it used to be possible
(Version 6? Maybe before that) to specify different directories for
project files and sources.

Jack Orenstein

---
Original message URL:
http://www.jetbrains.net/devnet/message/5265154#5265154

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Jack,

There are two ways to solve the problem.

1. I usually tell IDEA to keep its project file and all module files in a single separate directory (by convention it is .idea). When you create your project from external model (Maven), you can specify the directory path in the project creation wizard. Caveat: you have to do it twice, once on the very first page of the wizard for project file location, then on the very last page for module file(s) location. Once done, I add .idea directory to svnignore.

2. Scorched earth approach. Modify the global svn properties to make it ignore *.iml files.
Search for "global-ignores" on the following page:
http://svnbook.red-bean.com/en/1.5/svn.advanced.confarea.html

Hope that helps,
--
Sergei

0
Comment actions Permalink

The #2 Scorched earth approach worked fine for me in IDEA 9.0.2 on Linux Ubuntu 8 (added line "global-ignores = *.ipr *.iml *.iws" to my ~/.subversion/config), but this stopped working in IDEA 9.0.3 (build #IU-95.429)

I now again see all my .iml, .ipr, .iws files in my subversion Unversioned Files changelist. )-:

(I know this build fixed the problem where plain text subversion passwords were no longer cached in 9.0.2 builds, maybe my global-ignores are now being 'ignored'. (-:

0

Please sign in to leave a comment.