We're considering using Maven for a large multi project build, to give you an idea of the size, some of the sub-projects have several million lines of code.
The ideal structure would be something like:
- projectA
- module1
- module2
- projectB
- moduleAlpha (depends on moduleBeta)
- moduleBeta (depends on projectA:module1)
- ...
Where each module is actually a maven sub-project, and the dependencies are not always at the artifact level (i.e. jars), but rather cause the sub-project to be compiled as necessary.
Adding a common project root allows for expressing the dependencies as described, for example:
- project-root
- projectA
- module1
- module2
- projectB
- moduleAlpha (depends on moduleBeta)
- moduleBeta (depends on projectA:module1)
- ...
- projectA
But forces you to build from project-root. Remember that this is a very large project, and a full build would be something that is not always desirable.
Most teams work at the projectX level some even at the moduleX level.
What we need is to sometimes build against a generated artifact (that is the jar produced by module1), other times we want to build from the source code.
I have taken a look at the reactor plugin, that allows you to resume a build from a certain point or build only the dependents. But it seems very manual (although it is very useful in certain cases).
What I picture is some type artifact repository that builds the artifact when it is required. For example, making projectA an artifact repository that projectB references. When you for some reason need a rebuild of projectA's artifact, you could just remove the jar.
Is something like that implemented as part of Maven or as a plugin? If not, is it feasible to implement?