Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5104

Enforcing build order...

    XMLWordPrintableJSON

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)

      ...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)

      ...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:

      1. <root>
      2. Component A
      3. A.api
      4. A.jpa
      5. A.ejb
      6. Component B
      7. B.api
      8. B.jpa
      9. B.ejb
      10. Component C
      11. C.api
      12. C.jpa
      13. C.ejb

      ...however, in the second case Maven will not fail to build and instead come up with something like this:

      1. <root>
      2. Component A
      3. A.api
      4. Component B
      5. B.jpa
      6. A.jpa
      7. A.ejb
      8. B.api
      9. Component C
      10. C.api
      11. C.jpa
      12. C.ejb
      13. 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ancoron Ancoron Luciferis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: