Working with Maven

I've recently converted a project to Maven and everyone on my team uses IDEA.

The support seems good, but I have some serious issues.

The initial import of the pom.xml resolves dependencies properly and creates the necessary .iml files. However, they are not perfect. I need to tweak them to remove source directories that don't exist, exclude certain directories etc. Unfortunately these changes are written to the .iml files as well, and they get blown away next time the project is synced/imported.

I wish I could just commit some small .iml files that dictate the customizations I want, so that when users checkout a fresh project they can just import the pom.xml and have the settings ready to go. The same problem occurs if I add a new dependency and need to sync/re-import the project.

I wonder what existing users are doing to get around this? I could potentially commit the .ipr and .iml files into our VCS and have the users just use those directly, but then if a user needs to add or change a dependency they will have one hell of a time tweaking the files to be just right.

9 comments
Comment actions Permalink

hi, i know your problems.

have a try on maven command-line and run 'mvn idea:idea'. usually this maven plugin creates proper project/module files and IntelliJ does cope better.

0
Comment actions Permalink

Hello Kallin,

Which exactly version of IDEA are you using? Many problems with Maven integration
are fixed in the 7.0.4 EAP build available at http://www.jetbrains.net/confluence/display/IDEADEV/Selena+EAP

I've recently converted a project to Maven and everyone on my team
uses IDEA.

The support seems good, but I have some serious issues.

The initial import of the pom.xml resolves dependencies properly and
creates the necessary .iml files. However, they are not perfect. I
need to tweak them to remove source directories that don't exist,
exclude certain directories etc. Unfortunately these changes are
written to the .iml files as well, and they get blown away next time
the project is synced/imported.

I wish I could just commit some small .iml files that dictate the
customizations I want, so that when users checkout a fresh project
they can just import the pom.xml and have the settings ready to go.
The same problem occurs if I add a new dependency and need to
sync/re-import the project.

I wonder what existing users are doing to get around this? I could
potentially commit the .ipr and .iml files into our VCS and have the
users just use those directly, but then if a user needs to add or
change a dependency they will have one hell of a time tweaking the
files to be just right.

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


0
Comment actions Permalink

I've been using both 7.0.3 and the latest EAP, 7.0.4.
Things do seem somewhat improved in 7.0.4, but I've still seen it knock out some settings during a re-import. I also find it locks up a lot when i do a re-import, endlessly 'scanning files'. Maybe I need to give it more time, but after a minute with the same message I just restart.

0
Comment actions Permalink

Could you please attach the log file?
You can find it under the idea_home/system/log directory.

Thanks.

0
Comment actions Permalink

There are two logs files. I'm attaching both.
I had to split the idea.log.1 file because your system wouldn't let me attach a 1mb file.



Attachment(s):
idea.log.1-1
idea.log.1-2
idea.log
0
Comment actions Permalink

Kallin,

It seems that the problem is with one of your js files.
Could you please verify my theory? Please remove all the js files from the project and try to import it.
It would be great if you could find the exact file that causes the problem.

Thanks,
Anton Makeev

0
Comment actions Permalink

Unfortunately there must be about 1000 .js files in this project, and I don't have time to hunt down which one is causing the exception.

0
Comment actions Permalink

Have you tried to remove js files completely? Does it help to import the project?

0
Comment actions Permalink

I'll give it a shot when I have some time.

0

Please sign in to leave a comment.