One thing I'd like to change is that if a module is a dependency it must really behave like one. It should not be the MavenProject, that should only be used for building *that* project. It should act as if it was downloaded via the artifact resolver
Verzonden vanaf mijn Samsung Galaxy-smartphone.
-------- Oorspronkelijk bericht --------Van: Stephen Connolly <[hidden email]> Datum: 05-11-17 18:57 (GMT+01:00) Aan: Maven Developers List <[hidden email]> Onderwerp: Reactor safe/rally points
There are two sets of problems that, assuming we want to fix, both need
some way to rally a concurrent multimodule build at.
1. There is the shade like class of problems, where a plugin wants to
modify the effective transitive dependencies of a module.
2. There is the extensibility class of problems, where people want to build
a plugin and consume the same plugin in one reactor.
Now in both cases, I think we can solve a subset of these problems by
introducing a concept of a rally / safe point in the build plan.
The mutable model can be solved for reducing scope/ removing
dependencies... could possibly also allow adding dependencies, provided the
dependencies are not part of the reactor. The proviso is that the plugin
goal would need to be marked as a “mutation” goal, and the execution of all
“mutation” goals for a module defines a safe-point. All downstream modules
that declare a dependency must be blocked from execution until the
safe-point is reached.
* how do we handle a build request that will never reach the safe-point, eg
`mvn test` will not reach package, and hence will not rub shade... should
we say: fine, no safepoint in build plan, so all good... should we say:
oops escalate the module with a safe point to `package`?
* while technically possible to *add* ex-reactor dependencies (if
ex-reactor they cannot affect the build plan) it could be a bad idea for
build requests that wouldn’t reach the safepoint, is that reason enough to
The extensibility issue is actually an important case. Users want features
like scripting because they need something custom. Scripting brings back
imperative builds, which IMHO Maven views as an anti-pattern.
So what is the problem people are trying to solve? They want a plugin for
just one project. Right now you cannot because we cannot instantiate the
full build plan until we can inspect the plugin metadata... but until we
build the plugin we cannot get the metadata.
With a general plugin, I think there is not much we can do. For example a
plugin redefining a lifecycle might actually mean that the build plan will
be different for modules using that plugin as an extension.
But if the plugin is just defining some goals and those goals are just
bound to phases in the pre-existing life cycles... again, it seems we can
allow the build to proceed
* how to handle `mvn test`. If the plugin is only bound to later phases, we
are good... but what if the plugin is bound to an early phase? Do we just
bomb out and say, sorry you need to invoke at least package? Do we fall
back to local repo? Do we upscale the build plan for the plugin to package
* how to handle `mvn site`... in this case we wouldn’t be producing the
plugin in the reactor anyway... do we bomb out and say “you must do `mvn
package site`“? Do we modify the build plan? Do we use local repo?
* we could be smarter and use the build plan safepoint as a staging point
and allow lifecycles and other things... though obviously more work
* what about invoking a plugin goal from the CLI directly... do we ask for
`mvn package foo:manchu`? For this to work, foo:manchu would have to be an
aggregator goal, otherwise it could be an execution request on earlier
modules by a later module? Could we delay the build plan instantiation
until after the plugin is built? Could we just require the plugin be served
from the local repository and revalidate the build plan after the new
plugin build is available?
I think these are two improvements that could be made *without* changes to
the modelVersion and they would have a real and meaningful improvement for
our users... as such I would like us to consider (as optional goals) for
Sent from my phone
On Mon 6 Nov 2017 at 01:48, Charles Honton <[hidden email]> wrote:
> Both these use cases sound like adding incredible complexity to support
> less than 1% situations, and worse, encouraging monolithic builds.
> In the first case, the module creating a shaded jar can mark its
> constituent jars as optional; preventing the transitive dependencies.
Ha! That does not do what you think it does.
Optional dependencies are still there but only as a version constraint that
gets applied if something else brings the dependency into the tree in as a
Normally you need a complex deep tree to see the effect (as most people use
version hints rather than specifications... and with hints, closest wins,
whereas specifications are globally merged)
Provided scope is more correct, but shade doesn’t operate on provided
scope... and anyway iirc that also pushes the constraint as transitive.
With shade, the dependency is removed.
> In the second case, It would be better for the plugin be an independent
> build to encourage re-use of that plugin.
Yes it would, but socially people don’t do that... and anyway, there are
legitimate use cases, eg tomee has (or had if they gave up fighting and
moved it out of reactor) a plugin that was tied to the container version.
To allow integration tests in the same reactor as the main codebase, it is
reasonable to want the plugin built at the same time.
If we don’t allow people to build the plugin in the same reactor, they just
fight us and add scripts or move to other build tools... both of which
removes the benefits of Maven.
This would provide a better path, and eventually they will “see sense”
(translation, find other projects that need the same functionality) and
pull the plugin into its own reactor.
Sent from my phone
> > There are two sets of problems that, assuming we want to fix, both need
> > some way to rally a concurrent multimodule build at.
> > 1. There is the shade like class of problems, where a plugin wants to
> > modify the effective transitive dependencies of a module.
> > 2. There is the extensibility class of problems, where people want to
> > a plugin and consume the same plugin in one reactor.
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
|Free forum by Nabble||Edit this page|