Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
2.2.1
-
None
-
None
-
Linux AMD64
Description
Currently, building multi-module aka. reactor projects is working, but does not help the developers to ensure a certain level of isolation of their modules.
E.g. imagine the following project tree:
- <root>
- Component A
- A.api
- A.jpa
- A.ejb (depends on A.api, A.jpa)
- Component B
- B.api
- B.jpa
- B.ejb (depends on B.api, B.jpa, A.api)
- Component C
- C.api
- C.jpa
- C.ejb (depends on C.api, C.jpa, A.api)
- Component A
...and all things are just fine.
Now, some developer comes in, not fully aware of the "big picture", producing something like this:
- <root>
- Component A
- A.api
- A.jpa (depends on B.jpa)
- A.ejb (depends on A.api, A.jpa)
- Component B
- B.api
- B.jpa
- B.ejb (depends on B.api, B.jpa, A.api, C.ejb)
- Component C
- C.api
- C.jpa
- C.ejb (depends on C.api, C.jpa, A.api)
- Component A
...so in an old-school build with tools like Ant this would fail to build as the build order is clear and strict, according to best-practices. Not so with Maven. In the first case Maven might (although unlikely and yet to be seen) come up with a clear build order like this:
- <root>
- Component A
- A.api
- A.jpa
- A.ejb
- Component B
- B.api
- B.jpa
- B.ejb
- Component C
- C.api
- C.jpa
- C.ejb
...however, in the second case Maven will not fail to build and instead come up with something like this:
- <root>
- Component A
- A.api
- Component B
- B.jpa
- A.jpa
- A.ejb
- B.api
- Component C
- C.api
- C.jpa
- C.ejb
- B.ejb
All artifacts are build correctly, but it is no longer guaranteed that e.g. "Component A" could be used without "Component B", therefore introducing a requirement and eventually a lot of changes to the build-/tool-/test-chain.
So we would like to have an option to disable the Maven "magic" here and just stupidly build according to the <module> tags we've carefully written.