I am going to commit my changes for MNG-3004 to M3 for beta 1.
The change consists of the following:
* A modularization of the DefaultLifecycleExecutor into smaller
components. This is primarily done with the intention of extracting
execution strategy somewhat from the rest of the logic.
// builds for beta 1 (MNG-3004)
* Three differenent execution strategies:
A) Linear ("Classic")
B) Parallel (Based on Dan's original implemementation)
C) Weave (Still experimental)
The command line -T option activates parallel running, and the argument
is in the form
-T <[nThreads, a float][C][W]|auto>
The C flag scales threads according to CPU cores, this is why nThreads
is a float
The W flag activates weave mode (undocumented)
Examples:
"mvn -T auto install "
autoconfigures threads based on cpu count (1 thread per core).
"mvn -T 1.5C install"
Runs with 6 threads on a 4 core computer.
Runs with 2 threads on a single core computer.
"mvn -T 1.87CW install"
Runs with 7 threads weave mode on a 4 core computer.
Better suggestions welcome ;) Bikeshedding opportunities galore ;)
Risks/Consequences
=====
* I'm not particularly worried about functional regressions in Linear
mode, and Parallel mode is also stable.
* This does not mean the full set of maven plugins necessarily works in
parallel mode; I expect there will be issues with plugins that I have
not uncovered as of yet.
* There is a risk that I have removed some methods from
DefaultLifecycleExecutor that may have to be re-added (if they were not
documented as being externally in-use, I have removed them)
* From a maven-core perspective, I see no reason to flag "parallel" as
experimental.
* Weave mode is still experimental (and is not added to any official
API's - but parallel is). It's clearly pushing close to the limits of
what the JVM handles. I will be extending my testing onto Windows to
check behaviour on different platforms. My goal is to get this stable
before 3.0 final. The modularization of the lifecycle executor ensures
that most further changes will be contained to the single
"LifecycleWeaveBuilder" class (which encapsulates most of "weave" mode).
* Weave mode has some minor issues that are intentionally left TODO,
pending that the overall stability goals can be reached.
* I will be updating surefire to include the parallel->forkmode>=once
check.
* The change includes decent test coverage; no existing its were harmed
and quite a few new unit-tests have been added. I will elaborate these
even further in the weeks to come.
I'm not calling a vote on this, but now is the time for objections. I
will commit this in about 24 hours time unless there's any significant
objections. The current patch is at
http://github.com/krosenvold/maven3,
and if nothing else, I know Benjamin will be at it with his microscope
afterwards ;)
The only last thing I'll do now is to read/search through the core
plugins looking for references to methods I have deleted in
DefaultLifecyleExecutor.
Kristian
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]