Maven Multiple Module Project and Corresponding IDEA project

We have a multiple module Maven project that when imported into IDEA adds all the Maven module dependencies as Module Library dependencies in the IDEA Project/Module configurations.

Is it possible to make IDEA use the created IDEA Module in the dependencies as a Module Dependency, (that is create interdependencies within the modules) according the maven module pom.xml instead of including it as a Module Library? I can force it to do so manually, but I really don't want to have to edit the project structure when the Maven poms already specify it perfectly.

The maven-idea-plugin had the ability to do this, so it suprises me that it is missing in IDEA's Maven integration.

0
11 comments

It's supposed that IDEA would create very module inter-dependencies. If it doesn't that is probably because of pom configuration.
Could you please send simple pom structure that reproduces that?

0

On further investigation into what is going on I have found that the problem is coming from having an internal Maven repository that TeamCity deploys the Maven project artifacts to as part of our Continous Integration environment.

If there are no Maven artifacts in the internal repositories then the IntelliJ IDEA project will correctly reference the Maven sub-modules as "Module Dependency", as expected (and you have noted). As soon as our TeamCity build for the Maven project deploys the snapshot artifacts into our internal repository (which end up being downloaded into the local repository for the user), the IntelliJ IDEA project will switch over to using "Module Library" instead of the "Module Dependency" for the sub-modules in the maven project.

I would tend to think that this is a bug, as it is not really the desired behaviour for multi-module projects and Continuous Integration environments like TeamCity.

0

I see, thanks 8)
I've created jira issue for this (IDEADEV-22567).

0

Does this problem arise if you use 'install' goal on such modules (not team city deployment)?

0

I have the same problem, but using "install", as you said, on the core module does help.

0

If I use the "install" goal in TeamCity builds then this problem does not occur for us, but that introduces problems for us in the way we work as some builds need to use the "deploy" goal to make the Maven artifacts available to other builds as these artifacts are used as dependencies on other Maven projects.

Once again this only occurs on multi-module Maven projects and not on simple basic Maven projects that produce one artifact.

0

Same here : developers do not use the "install" goal, and "deploy" is automatically made by TeamCity (snapshots). So the problem occurs (almost) every day, since new snapshots are released. This obliges the devs to "install" a local copy although it should not be required.

0

The root problem is that maven embedder tries to get the most recent version of artifact (the module that another module depends on). If it sees new version in global repository (after is was placed there with "deploy" command).

Nevertheless it is bug of course. And it will be fixed as soon as it possible.

0

Any estimate on when this bug will be fixed?

0

I'm working on this issue at this moment 8) I hope bug fix will be available in the next eap

0

This bug has been fixed. Please try next eap (it should be available later today)

0

Please sign in to leave a comment.