Since no discussion started after this proposal, I have to assume that the
base of this proposal is good.
I'll translate it into a Jira issue as part of the next Major Maven
release.
thanks,
Robert
Op Mon, 23 Jun 2014 23:11:46 +0200 schreef Robert Scholte
<[email protected]>:
PROPOSAL 1: PerProject and PerPhase Executions
I've recently introduced the installAtEnd/deployAtEnd as an experimental
feature which should improve the behavior of Maven without having to
wait for the implementation in Maven Core, which would have a huge
impact.
The reason is that you only want to install and/or deploy only after all
modules have been build and verified successfully.
This feature works for most projects, however there are cases which
cannot be solved by the plugin solution and require a change in the
handling of lifecycles in Maven Core.
Up unto the verify-phase you want to execute all phases per project,
whereas the install and deploy should be executed per phase.
Consider a root project with 2 modules, these should be executed like
this
root : validate ... verify
module1: validate ... verify
module2: validate ... verify
root : install
module1: install
module2: install
root : deploy
module1: deploy
module2: deploy
PROPOSAL 2: Either install or deploy
In general one should either run 'mvn verify' or 'mvn deploy', there's
often no reason to run 'mvn install'. The only reason I can think of is
when you have 2 separate projects (not part of the same multimodule),
one depending on the other and you want to test this.
To ensure that your projects build the same as your co-workers, you
should always try to deploy it. However, there are several reasons why a
deploy could fail: network problems, authentication/authorization
issues, repository manager policies, etc. However, this is still after
every install-phase, so the local repository is polluted.
This is as unpleasant as for a developer local repository as for a
CI-server local repo.
The proposal is to "branch" the final phases.
Calling any phase up until the verify will stay the same.
Calling 'mvn install' would call these phases: validate ... verify,
install (nothing new here)
Calling 'mvn deploy' would call these phases: validate ... verify,
deploy (no more install)
Both proposals should have a generic implementation, since it's not just
a problem of the default/build lifecycle. Also the site lifecycle
requires the same type of handling.
PROPOSAL 3: post-<phase> should always be executed after <phase>
There are right now 3 phases which also have a pre-<phase> and
post-<phase>, namely integration-test, clean and site. However, even if
one has bound goals to the post-phases, they're probably never called.
When there's an integration-test starting up some server, you'd probably
always want to kill it no matter what happens during the IT (let say a
NPE).
The proposal is to execute the post-<phase> as the finally block in
Java. If you really want to execute only the integration-test without
the post, the phase should be marked, e.g. 'mvn [integration-test]',
where the brackets lock the phase.
thanks,
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]