Building dependencies of dependents and dependents of dependencies

216 views Asked by At

The -am (also make dependencies) and -amd (also make dependents) command line options can be used together but they will not work transitively to e.g. make the dependents of a dependency. E.G. will

$ mvn  -amd -am -pl test:c clean

build b, c and d - but not a or e given the following reactor (groupId=test) module dependency graph:

dependency graph

I'd like to build all modules that could have been affected by a code change in e.g. c - is that possible in maven? I guess this is equivalent to all vertices that is reachable from c, i.e. in this case all modules except f and g.

1

There are 1 answers

0
Stefan Ferstl On BEST ANSWER

There aren't any options in Maven to achieve what you like to have. The -amd option will traverse the whole module tree below the specified module (c in your example). The -am option will traverse the path to the root of your module tree.