Dynamic phases proposal

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic phases proposal

stephenconnolly
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic phases proposal

Emmanuel Bourg
Le 25/10/2019 à 21:01, Stephen Connolly a écrit :
> https://cwiki.apache.org/confluence/display/MAVEN/Dynamic+phases
>
> Thoughts?

Sounds interesting. You may want to forbid the before/after prefix on
the deprecated phases (such as after:pre-clean).

The name of the phases use to start with a verb, that would no longer be
true with the proposed 'sources' and 'resources' phases. Since it isn't
that common to invoke these phases directly from the command line maybe
the longer name could be retained to preserve the consistency
(generate-sources, etc).

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Dynamic phases proposal

stephenconnolly
On Fri 25 Oct 2019 at 22:48, Tamás Cservenák <[hidden email]> wrote:

> I am referring to this sentence:
> "The logic of using :  in these prefix names is that it would expressly be
> impossible to invoke these dynamic pseudo phases from the CLI as Maven will
> interpret any attempt to invoke them as $plugin:$goal and look for a
> maven-before-plugin  or maven-after-plugin".
>

We can put specific checks in to give friendly error messages, but
fundamentally Maven will treat a CLI argument with one colon as a plugin
goal to execute separate from the lifecycle

We want the before and after phases to not be directly invoked via CLI or
invoker, and because you cannot have a phase with this name, it’s safe to
reuse


>
>
> On Fri, Oct 25, 2019 at 11:13 PM Stephen Connolly <
> [hidden email]> wrote:
>
> > On Fri 25 Oct 2019 at 21:41, Tamás Cservenák <[hidden email]>
> wrote:
> >
> > > The fixed phases were one of the main strengths of Maven, and with this
> > > automatism it could really be enhanced.
> > >
> > > My dislike: the `before:goal` invocation is being "projected" to non
> > > existent plugin invocation. This sounds like a hack. Could we clear
> that
> > > part up?
> >
> >
> > Could you explain what you mean? I’m not seeing what you are saying
> >
> >
> > >
> > > T
> > >
> > > On Fri, Oct 25, 2019 at 10:23 PM Emmanuel Bourg <[hidden email]>
> > wrote:
> > >
> > > > Le 25/10/2019 à 21:01, Stephen Connolly a écrit :
> > > > > https://cwiki.apache.org/confluence/display/MAVEN/Dynamic+phases
> > > > >
> > > > > Thoughts?
> > > >
> > > > Sounds interesting. You may want to forbid the before/after prefix on
> > > > the deprecated phases (such as after:pre-clean).
> > > >
> > > > The name of the phases use to start with a verb, that would no longer
> > be
> > > > true with the proposed 'sources' and 'resources' phases. Since it
> isn't
> > > > that common to invoke these phases directly from the command line
> maybe
> > > > the longer name could be retained to preserve the consistency
> > > > (generate-sources, etc).
> > > >
> > > > Emmanuel Bourg
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> > --
> > Sent from my phone
> >
>
--
Sent from my phone
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic phases proposal

rfscholte
In reply to this post by stephenconnolly
To avoid confusion, let's call it stages.

Stage 1: Always call post-bound executions (MNG-5665[1])
Stage 2: before and after
Stage 3: priorities (MNG-3522[2])
Stage 4: transitional lifecycle

For both all you need to start evaluating the value of phase.
For now we can assume that after:clean is just another label for post-clean and will have exactly the same effect.
MNG-5665 contains a proposal to change the xml, but we shouldn't do that (yet). Let's start with a hardcoded list of postphases (or in case a goal fails, see if a post-x phase exists). Stage 1 is to make it work, stage 2 to make it configurable.
IIRC you cannot ask from inside a Mojo if is was called explicitly or because it was bound to a phase, nor can you ask for the value of this phase. I kind of like this, plugins shouldn't care about this.
However, inside Maven it will become important at which phase it is to know if there are more executions to call OR create blocks of executions. Now it is just a list of executions: loop and fail fast.

thanks,
Robert

[1] https://issues.apache.org/jira/browse/MNG-5665
[2] https://issues.apache.org/jira/browse/MNG-3522
On 25-10-2019 21:33:14, Stephen Connolly <[hidden email]> wrote:
Robert,

I would be fine splitting out into, pardon the pun, phases:

Phase 1: before and after
Phase 2: priorities 
Phase 3: transitional lifecycle

Might have a phase 1.5 of before:* and after:* to catch the start of a lifecycle and the end of a lifecycle...

On Fri 25 Oct 2019 at 20:30, Stephen Connolly <[hidden email] [mailto:[hidden email]]> wrote:

Robert, Michael, Tibor, let’s continue here (though I asked Infra and it’s fine that anyone in the community can join our Slack)

On Fri 25 Oct 2019 at 20:01, Stephen Connolly <[hidden email] [mailto:[hidden email]]> wrote:

https://cwiki.apache.org/confluence/display/MAVEN/Dynamic+phases [https://cwiki.apache.org/confluence/display/MAVEN/Dynamic+phases]

Thoughts?
--

Sent from my phone
--

Sent from my phone
--

Sent from my phone