-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-8052] New lifecycle for Maven 4 #1448
Conversation
528b744
to
70e4122
Compare
705fd88
to
1446474
Compare
@gnodet One of our tests broke after this change made it into the nightlies - We test a custom lifecycle like
Before this change, the phases were executed in the correct order, i.e. calling Looking through the Maven integration tests, there doesn't seem to be a test case for custom lifecycles. And since maven-core no longer uses components.xml itself, this went undiscovered. |
Could you raise a JIRA issue and provide a small project to reproduce the problem ? |
https://issues.apache.org/jira/browse/MNG-8299 Also opened two for other recent regressions: |
JIRA issue: MNG-8052
The lifecycle is now defined as a tree of phases, each phase being split with a
before:
phase and aafter:
phase. Each phase is given a list of timing constraints: a phase from the same lifecycle (compile
must be executed aftersources
), a phase in project dependencies (compile
must execute aftercompile-only
project dependencies have reached theready
phase), or a set of children project dependencies (to re-define aggregators, not yet implemented).The default lifecycle is defined in the
DefaultLifecycleRegistry
In addition to the
before:
andafter:
prefixes, an ordering can be defined by appending an integer inside brackets, for example,after:integration-test[1000]
.Note that there are a few changes with the Maven 3 default lifecycle: it's a graph, so
sources
does not always execute afterresources
, norcompile
afterresources
. Also, unit tests and integration tests have been moved to theverify
phase which is run last inside thebuild
phase, but not in thepackage
phase. The goal is to have a phase (here,package
which can run all the reactor with no tests). In order to be compatible, old phases are mapped to new ones using aliases. Theinstall
anddeploy
phases now depends onpackage
, but notverify
(anddeploy
does not requireinstall
). This currently has no effect when callingmvn deploy
, as the ordered list of phases is still used to compute the build plan (see #1429).It's missing the ability to create some scheduling constraints in the POM and to define custom phases. All executions in a given phase such as
compile
orafter:sources
are executed sequentially, but it would be nice to be able to execute them in different subphases, so that they could be executed concurrently.This PR is required for #1429