Skip to content

Let m2e discover the build tree of a project from its projects #904

@laeubi

Description

@laeubi

Currently the view of m2e to a multi module project is simply flat... each project is handled as its own. When working with a mult-module build, there is actually some kind of tree structure of related projects that are likely to work together.

Because of this, it would be useful to have a function in m2e that takes a single project as its input and then traverse to the modules declared for them and mark such projects in a special way as a multi-module aggregator.

This can then be used to:

  • represent the structure in the project view (not yet checked how hard this would be)
  • building more than one project (maybe in parallel) in one execution (that will be important for mojos scanning the set of reactor projects, e.g. Tycho)
  • reuse maven facilities to compute what projects needs updates (-am / -amd) instead of m2e trying to figure this out directly

While it sound obvious there are some challenge:

  1. A single (physical) maven module could be mentioned in several pom.xml files
  2. A pom.xml might include modules outside the workspace
  3. A pom.xml with modules might not necessarily be a parent of the module it includes

Because of this, the idea would be to have a special project type a user could import named "Multi Module Maven Project" where I must point m2e to one pom.xml file that contains <module> declarations and m2e then uses this as the root to source the list of projects to import (that of course can contain other modules as well).

The final goal would be, that the only thing required as a user is that I point m2e to my "root pom" and everything else is handled automatically, I get a tree that represents the structure of my modules and I can build/use each sub project as if called from the command line with -am and if I change something in the child each dependent project is also updated similar to -amd).

This relates to the story

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions