Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347111

Summary: Module Dependencies not in the Maven Dependencies path
Product: z_Archived Reporter: fox_zprjrm
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description fox_zprjrm CLA 2011-05-25 03:26:32 EDT
Hi,

I have a simple Java project with a module in Eclipse 3.6.
myproject
 |- pom.xml
 |- src
    |- main
       |- java
 |- module1
    |- pom.xml
    |- src
       |- main
         |- java

if I add a dependency in pom.xml root, I see the dependency in the Maven dependencies.
if I add a dependency in pom.xml of module, I don't see the dependency in the Maven dependencies.

Noted that I added the following lines in the file "org.maven.ide.eclipse.prefs" but it changes anything:
includeModules=true

The following commands didn't resolve my problem :
- Right Click -> Maven -> Update project Configuration
- Right Click -> Maven -> Update Dependencies
- Project -> Clean...
- Close the projet and reopen it

So, what I'm doing wrong?

Regards,
Thomas
Comment 1 Igor Fedorenko CLA 2011-05-25 08:13:55 EDT
What you see is correct and expected behaviour. Both maven on command line and m2e, calculate dependencies independently for each project (i.e. pom.xml). Changing dependencies of child modules does not affect dependencies of an aggregator project.

It is not possible to map multiple maven modules to a single workspace project (i.e. includeModules=true). This has been deprecated in m2e 0.10 and completely removed in 0.12.
Comment 2 fox_zprjrm CLA 2011-05-25 13:05:09 EDT
(In reply to comment #1)
> This has been deprecated in m2e 0.10 and completely removed in 0.12.

OK, I didn't know it.
Why is there removed it? Is it because it allows to have a separate dependencies path for each module?

Regards,
Thomas
Comment 3 Igor Fedorenko CLA 2011-05-25 13:16:11 EDT
Mapping multiple maven modules in one workspace project does not provide sufficient granularity to correctly configure the projects. For example, if one the source tree has jar, war and ear modules, there is no way to map this properly to wtp. But even for "plain" jar modules, managing classpath can be a problem as in most cases individual modules will have different dependencies. So such aggregate projects are only useful for read-only or almost read-only situation, when the user wants to look at the code but do no or very limited amount of actual "development" (as in "Integrated Development Environment").

At the same time supporting these aggregates was a major effort for m2e team and when weighted benefits against costs we decided to remove this functionality. 

Of course, we will re-evaluate this decision when and if Eclipse workspace provides proper support for nested project structure.
Comment 4 fox_zprjrm CLA 2011-05-25 13:26:42 EDT
Thanks for your explanation.
Comment 5 Denis Roy CLA 2021-04-19 13:22:16 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/