Tighter Maven Integration Follow
First of all congrats for a great product and the decision of free community edition!
I am using Maven intensely and so far Idea has proven to be quite ok in its Integration with maven. Please however consider this case and let me know if you think this is feasible now or in the future.
I am using two multi modules projects (platform and app), both are maven projects with multiple modules on multiple levels. The app project has dependencies on the platform project and I am usually working in two windows, one window for each project.
The problem is that every time I change something in the platform project I have to repackage everything (mvn install) in order for the changes to reflect in the app project and this is quite time consuming.
Is there a way for Idea to recognize that the platform artifacts are in fact modules in an open idea project and therefore:
- automatically pick the sources from there (while debugging for instance) ?
- perform some kind of artifact recognition and resolve the artifacts within the maven workspace rather than the maven repository (something similar to M2Eclipse's Enable Workspace Resolution) ?
Thank you for your time,
Please sign in to leave a comment.
I am also a big maven user with IntelliJ. I am quite happy about its integration.
I also use multi-modules and never have problems with it. Just do:
-File -> Open Project....
-Search your pom.xml (which is representing the multimodule having the <modules>...</modules> declaration)
-Open this pom.xml
All gets included correctly without the need to do any 'mvn install' ever.
Maybe you imported the wrong pom.xml?
You didn't got Rares Pop's point.
If you have two maven projects where a module (1) from project (A) depends on module (3) of project (B) and both projects are currently opened in two separate idea windows, a change in module (3) in project (B) won't be recognized in project (A) as long as you don't rebuild the project (B) with 'mvn install'.
if module (3) from project (A) is itself not defined as a module of project (B), i don't think there is a way. afaik projects/sources are only included directly in idea-project if it is a module, otherwise it is treated as normal dependencies through maven repository.
generally this two-idea-window approach sounds a bit unnatural. what i would suggest that you tweak your maven project setup:
-platform/pom.xml //platform multimodule
-app/pom.xml //app multimodule
now app/pom.xml includes also the platform multimodule:
when now importing app/pom.xml with idea you have all the maven-projects/modules in one idea-project. this way you just have one idea-window open and everything in one place. i think this feels more natural as going with to separate idea-windows "cross-including modules".
Thanks for responding. Your solution may fix Idea's shortcomings on this one, but I will have to use a new profile (or a combination of profiles) specially designed for Idea in order not to break the CI builds.
I was wondering if there are any plans for tighter maven integration in future Idea builds. My problem above has deeper ramifications however:
- hot swapping dependent classes after compiling from within idea
- ability to configure a project's integration with maven life cycle - i.e. what goals to launch before/after building
Netbeans 6.8 has made significant progress in integration with maven 3.0 and is something worth looking at for inspiration for Idea developers.