Selena M2 problem with multi-module dependencies (maven2)

Hi !

I want to import a multi-module maven2 project into Selena M2.

In my (simple) scenario there are 2 modules (A and B), B depends on A.

Because of this I define module A as a dependency in module Bs pom.xml, for maven to resolve the build-order correctly:

... moduleA ... ]]>

Instead of importing the pom and adding some module-dependency to the idea-project, idea just stops importing the pom of module B, leaving the library section completely empty.

When removing the dependency-entry, Selena will import the pom but is unable to build the project because of the missing dependencies to module A.

I can fix this by manually entering the 'module dependency' into the project settings tab, but this setting is overwritten everytime I sync with the parent pom :(

Any ideas about this behavior ?

Thank you in advance,
Gerald

3 comments
Comment actions Permalink

TO have multi module dependencies you need to have a section in a parent pom and not just a ]]>.

The dependency will be resolved as a jar dependency only.
The current state of the maven integration causes it to fail when dependencies can not be resolved (eg downloaded or found in local repo) and i guess you didn't install your module A, thus the failure.

0
Comment actions Permalink

Ah, you got me ;)

Thank you for your fast answer !

I am just in the process of switching from Eclipse to IDEA, using Selena M2 as a launch pad ... so there are some things to learn left ;)

While the ]]>-section is present in the parent-pom, the module artifacts where not installed/deployed at this time.

When resolution of artifacts is on a 'jar'-level, this behavior absolutely makes sense.

Is there a chance/a plan to get the integration of maven so far that there is a kind of 'auto-detection' of those modules grouped in the same parent, like maven itself is doing ?

Gerald

0
Comment actions Permalink

Hmmm .. I just gave it a try:

After installing the modules into the local repository, removing the module-dependency from the project-settings tab and syncing with the maven-project, the module-dependency was added to the project-settings automatically. Cool !

But the dependency was not 'recognized' by IDEA, thus compiling the source results in an error (classes not found).

The only way to get things working again, was to remove and add the module-dependency by hand.

So the integration seems to be on the right path with some minor glitches ;)

0

Please sign in to leave a comment.