You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Gier <pg...@redhat.com> on 2008/11/07 21:45:49 UTC
Default plugin execution id
Hi everyone,
I'd like to be able to configure the default execution of a plugin within an
execution instead of doing it through the main plugin configuration. So the
result would look something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default</id>
<configuration>
<includes>
<include>stuff/**</include>
</includes>
</configuration>
</execution>
<execution>
<id>custom</id>
<configuration>
<includes>
<include>other-stuff/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
Currently, it seems the only way to configure the default jar plugin execution
is to use the main plugin configuration section. This doesn't work as well
because it ends up applying the config to all executions, which is not always
what is needed.
Benjamin pointed me to the MojoExceution constructor which sets the id to null,
and PluginExecution from the model which sets the id to "default". This
difference seems to be why the default executions can't be overridden in an
execution config.
Any thoughts? I'll create a jira issue with a patch for this, but I'll wait for
feedback before changing anything.
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
I still think that the id has to include the phase that the execution is
bound to. I'm not tied to specification of the packaging, but I do think
that the phase (given that an execution is associated with one and only one
phase) has to be part of the id for *lifecycle introduced* executions.
-Stephen
2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
> I think we've gone way off the rails here. I see there's a proposal but
> haven't reviewed it yet.
>
> The first portion of this discussion was rather small in scope:
> Currently default executions of plugins have a null id. The null is used
> to indicate the default config for a plugin across all executions AND is
> used for lifecycle bound or plugins run on the cli. I think we simply
> should start by separating this. Keep default to replace the current
> null values for the global plugin configuration as it applies across all
> executions. Then define an id for the lifecycle and cli invocations to
> be applied to tweak the values as needed (but keeping default to apply
> across all). Going beyond this into multifaceted ids for packages etc is
> far too complicated imo.
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 3:44 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Stephen Connolly wrote:
> > 2008/11/10 Paul Gier <pg...@redhat.com>
> >
> >> What about adding new syntax to the goal string? So that from the
> command
> >> line you could write something like this to refer to specific
> execution
> >> configs:
> >>
> >> mvn eclipse:eclipse{execution-1}
> >> or
> >> mvn eclipse:eclipse{execution-2}
> >>
> >
> > How would that interact with the lifecycle?
> >
> > If I define execution-1 as attached to the compile phase, does that
> mean
> > that Maven will execute all phases upto compile and then just execute
> > eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring
> any
> > plugins that are attached to prior phases? (With the side effect that
> I'd
> > loose the information of the extra attached source directories)
> >
> > The more I think about it, calling out a specific execution *that has
> been
> > attached to a specific phase* is a bad bad pattern, and it's a good
> thing
> > that Maven does not let you do that.
> >
> > If you need to do a pile of every-so-often tasks I'd define them in
> profiles
> > with each profile attaching the plugins to the requisite phases and
> defining
> > the defaultGoals to the highest phase necessary.
> >
> >
> >> The curly braces already seem to be associated with execution ids in
> >> maven's logging output. This would mean that components.xml file in
> maven
> >> core could be changed to provide execution IDs for each plugin that
> is
> >> executed, but probably no one wants to manually update this all the
> time.
> >>
> >> IMO the wildcard syntax is more than what is needed, and will make
> the pom
> >> a little less readable. The choice should be configure all
> executions or
> >> just one, otherwise it starts getting too complicated.
> >>
> >> After looking into the current behavior a little more, it is possible
> to
> >> execute the same plugin goal twice in the same phase. So I think all
> the
> >> naming schemes proposed except maybe Brett's
> >> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> future.
> >> But if we include a sequence number, then what happens if you add
> another
> >> execution of an existing plugin to the lifecycle? Do all the
> sequence
> >> numbers have to increment to make room?
> >>
> >
> > Plus sequence number is non-deterministic. Also, you are
> forgetting... this
> > is not the id of executions *defined within the pom* but it's the id
> of
> > executions *defined by either the lifecycle or the plugin's mojo
> bindings*
> >
> > I don't see how a mojo's descriptor can bind to any more than one
> phase, so
> > I guess the only thing preventing uniqueness is if the lifecycle can
> invoke
> > the same goal multiple times in the same phase... but hang on, how is
> that a
> > problem if we say that the execution is per phase (unless you want to
> > configure the different multiple executions differentially.... sounds
> like
> > you're writing a severe hack)
> >
>
> I just said that sequence numbers are the only way suggested that
> completely
> avoid id conflicts, but you're right it has other problems.
>
> I don't think it's a severe hack to have two executions for the same
> plugin goal
> in the same phase. For example, let's say I want to generate three jar
> files
> with different manifests during the package phase. I need to call the
> assembly
> or jar plugin three times with different configurations. I'm just
> saying it's
> possible to have this scenario even in a default lifecycle, so there is
> a small
> possibility of a name conflict even if we use something like
> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
> >
> >> I think if we add the goal name to the execution like Benjamin
> suggested,
> >> we will be unlikely to run into conflicts. So I would prefer
> something
> >> like:
> >>
> >> default-lifecycle-compile
> >> default-lifecycle-testCompile
> >>
> >
> > No, what if I bind compile goal to the compile phase and
> process-classes?
> >
> > Now I have an execution that is bound to two phases (not allowed) or
> two
> > executions with the same id (not allowed)
> >
> > I'm sorry, but I don't see how you can exclude the phase from the
> > execution's id...
> >
> > And given that phases consist of names separated by -, it seems
> confusing to
> > name them with - as a separator.
> >
>
> Adding the phase to the ID doesn't prevent name conflicts, since you can
> have
> the same goal twice in the same phase. I would guess it's actually be
> more
> common to have a goal twice in the same phase vs. in different phases.
> So I
> think the goal name is a better qualifier than the phase.
>
> > Now I don't mind if we do
> >
> > default-lifecycle:compile
> > default-lifecycle:test-compile
> >
> > or
> >
> > lifecycle:compile
> > lifecycle:test-compile
> >
> > or
> >
> > lifecycle:jar:compile
> > lifecycle:jar:test-compile
> >
> > or even use a different separator ('/' anyone?)
> >
> > The only advantage of specifying the packaging type is if you have a
> common
> > root pom. Wildcards only become really important if you use packaging
> in
> > the id, but there is still the issue of what if I need to specify
> something
> > for all executions (but keep the defaults outside of an execution
> different
> > for when executing goals directly from the command line)
> >
> > I can live without wildcards.
> >
> > Sequence numbers are either non-deterministic, or will end up having a
> 1:1
> > mapping with each phase, so why not just use the phase. Goal is
> non-unique,
> > and has the problem of multiple executions, and we can likely get away
> with
> > just phase anyway.
> >
> >
> >> When building, this logs to the command line like this:
> >> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
+1 here.
-----Original Message-----
From: Jason van Zyl [mailto:jvanzyl@sonatype.com]
Sent: Saturday, November 08, 2008 12:15 PM
To: Maven Developers List
Subject: Re: Default plugin execution id
I don't think anyone is generally going to type:
default-execution-id
It says what it is and if someone happens to look at the effective POM
they will understand. It's also unlikely someone would actually use
that in their own POMs.
On 8-Nov-08, at 2:23 AM, Benjamin Bentmann wrote:
> Brett Porter wrote:
>
>> How about #groupId:artifactId:sequenceNumber.
>
> What would be the sequenceNumber part? This kind of execution config
> is surely an edge case but I would prefer the execution id to not be
> too complex/cryptic (someday I might want to type it into the POM...).
>
>> It would be unique to the POM.
>
> AFAIK, execution ids were meant to assist in merging inherited
> configuration. As this happens on a per plugin basis, we don't have
> need for ids which are unique to the entire POM, do we?
>
> Besides, I start wondering how this relates to MNG-3203. Assuming
> for a moment
> a) there is one execution per plugin goal and
> b) the implicit execution ids where equal to the executed plugin goal
> it seems something like
>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <executions>
> <execution>
> <id>compile</id>
> <configuration>
> <!-- parameters for main compilation here -->
> </configuration>
> </execution>
> <execution>
> <id>testCompile</id>
> <configuration>
> <!-- parameters for test compilation here -->
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> would naturally extend Paul's original use case.
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
the course of true love never did run smooth ...
-- Shakespeare
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Paul Gier <pg...@redhat.com>
>
> Adding the phase to the ID doesn't prevent name conflicts, since you can
> have the same goal twice in the same phase. I would guess it's actually be
> more common to have a goal twice in the same phase vs. in different phases.
> So I think the goal name is a better qualifier than the phase.
>
>
I agree when we are talking about executions introduced via the pom... but
via the lifecycle, all you'll do is create the same jar three times as the
lifecycle does not provide a way to specify *in the lifecycle* different
configurations for the three executions... which is why we have
compile:compile and compiler:testCompile
-Stephen
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Jason van Zyl wrote:
> I don't think anyone is generally going to type:
>
> default-execution-id
>
> It says what it is and if someone happens to look at the effective POM
> they will understand. It's also unlikely someone would actually use
> that in their own POMs.
>
Although not an apache developer, I must say, I disagree with that. As
Brian already pointed out, that bug cannot be fixed in Maven 2.0.x
correctly since it would break builds using _broken_ POMs. When fixing
this for >= 2.1 things should be done right and not worked around. Here
is an example of what I think is right.
<plugin>
<executions>
<execution>
<goals>
<goal>goal-a</goal>
<goal>goal-b</goal>
</goals>
<configuration>
<property>value-b</property>
Configuration of the default execution for goals
goal-a and goal-b goes here, overwriting any
configuration of the default execution for all
goals given below. Note the missing execution id!
That is the same as writing <id>default</id> as that
is what is defined in the schema as the default value
of an execution id. You really want people to write
<id>default-execution-id</id> here ? Why is the
execution id optional then ?
</configuration>
</execution>
<execution>
<goals>
<goal>goal-c</goal>
</goals>
<configuration>
<property>value-c</property>
Same as above for the default execution of goal-c.
</configuration>
</execution>
</executions>
<configuration>
<property>value-a</property>
Configuration of the default execution for all goals of
the plugin goes here. That default execution needs to
have the same execution id internally as what is used
when a specific execution has no id defined in the
POM. That is "default" for the current XML schema.
</configuration>
</plugin>
I think the correct solution is to use "default" since that is
consistent with the XML schema. Someone using a POM which relies on the
bug (default execution of all goals is not the same as the default
execution referred to by an execution without an id or with an id equal
to "default") has to fix the POM when upgrading to 2.1. That is the
purpose of having that 2.1!
-1
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Paul Gier <pg...@redhat.com>
> Yes, you're right, I think this is getting more complicated that it needs
> to be.
> Either of these is fine with me:
> default-lifecycle:goal
-1
> or
> default-lifecycle:phase
+1
>
> Either of them should be pretty easy to implement, and pretty unlikely to
> cause any new problems. If we just use default by itself, then we don't
> resolve compile/testCompile or other similar situations.
>
>
> Brian E. Fox wrote:
>
>> I think we've gone way off the rails here. I see there's a proposal but
>> haven't reviewed it yet.
>>
>> The first portion of this discussion was rather small in scope:
>> Currently default executions of plugins have a null id. The null is used
>> to indicate the default config for a plugin across all executions AND is
>> used for lifecycle bound or plugins run on the cli. I think we simply
>> should start by separating this. Keep default to replace the current
>> null values for the global plugin configuration as it applies across all
>> executions. Then define an id for the lifecycle and cli invocations to
>> be applied to tweak the values as needed (but keeping default to apply
>> across all). Going beyond this into multifaceted ids for packages etc is
>> far too complicated imo.
>>
>>
>>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
I don't see that these things can be separated.
An execution is tied to one and only one phase.
If a plugin invokes multiple goals in different phases (and given that two
of our most prominent plugins do just that) it does not make sense to have
one execution that spans two or more phases.
So you're left associating an execution with either a phase or something
smaller.
We do not currently have something smaller, and coming from the lifecycle, I
don't see how we could get something smaller, so phase is the smallest
division that meets the requirements IMHO
-Stephen
2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
> Well now you've crossed over to http://jira.codehaus.org/browse/MNG-3203
> which is a separate issue imo.
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
> Sent: Monday, November 10, 2008 4:41 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> We need to split out the different executions somehow.
>
> If we use a sequence number:
> 1. How do I deterministically know what sequence number to use?
> 2. What happens when a newer version of the lifecycle introduces an
> earlier
> execution?
>
> On my count, that leaves a sequence number nearly dead
>
> If we use the goal name:
> 1. What happens if the goal appears more than once? (OK, so coming from
> the
> lifecycle, this is likely not too big an issue as the lifecycle will not
> allow differential configuration of the same goal executed twice... but
> it
> may be that the mojo infers things from the reactor / or updates to the
> Maven project... for example we may want to enforce some things at the
> start
> and then enforce more things at a later phase)
>
> The only thing that we know occurs only once is the phase...
>
> The down-side of the phase is multiple executions in the one phase would
> share the same configuration.
>
> -Stephen
>
>
> 2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
>
> > I don't see how phase is really needed. It applies to only two plugins
> > that I can think of, compiler and resources, and this is a bigger
> > problem for a 3.x timeframe. I think that something simple can cover
> 90%
> > of the cases and be doable in 2.x
> >
> >
> > -----Original Message-----
> > From: Paul Gier [mailto:pgier@redhat.com]
> > Sent: Monday, November 10, 2008 4:05 PM
> > To: Maven Developers List
> > Subject: Re: Default plugin execution id
> >
> > Yes, you're right, I think this is getting more complicated that it
> > needs to be.
> > Either of these is fine with me:
> > default-lifecycle:goal
> > or
> > default-lifecycle:phase
> >
> > Either of them should be pretty easy to implement, and pretty unlikely
> > to cause
> > any new problems. If we just use default by itself, then we don't
> > resolve
> > compile/testCompile or other similar situations.
> >
> > Brian E. Fox wrote:
> > > I think we've gone way off the rails here. I see there's a proposal
> > but
> > > haven't reviewed it yet.
> > >
> > > The first portion of this discussion was rather small in scope:
> > > Currently default executions of plugins have a null id. The null is
> > used
> > > to indicate the default config for a plugin across all executions
> AND
> > is
> > > used for lifecycle bound or plugins run on the cli. I think we
> simply
> > > should start by separating this. Keep default to replace the current
> > > null values for the global plugin configuration as it applies across
> > all
> > > executions. Then define an id for the lifecycle and cli invocations
> to
> > > be applied to tweak the values as needed (but keeping default to
> apply
> > > across all). Going beyond this into multifaceted ids for packages
> etc
> > is
> > > far too complicated imo.
> > >
> > > -----Original Message-----
> > > From: Paul Gier [mailto:pgier@redhat.com]
> > > Sent: Monday, November 10, 2008 3:44 PM
> > > To: Maven Developers List
> > > Subject: Re: Default plugin execution id
> > >
> > > Stephen Connolly wrote:
> > >> 2008/11/10 Paul Gier <pg...@redhat.com>
> > >>
> > >>> What about adding new syntax to the goal string? So that from the
> > > command
> > >>> line you could write something like this to refer to specific
> > > execution
> > >>> configs:
> > >>>
> > >>> mvn eclipse:eclipse{execution-1}
> > >>> or
> > >>> mvn eclipse:eclipse{execution-2}
> > >>>
> > >> How would that interact with the lifecycle?
> > >>
> > >> If I define execution-1 as attached to the compile phase, does that
> > > mean
> > >> that Maven will execute all phases upto compile and then just
> execute
> > >> eclipse:eclipse, or is it just executing eclipse:eclipse and
> ignoring
> > > any
> > >> plugins that are attached to prior phases? (With the side effect
> that
> > > I'd
> > >> loose the information of the extra attached source directories)
> > >>
> > >> The more I think about it, calling out a specific execution *that
> has
> > > been
> > >> attached to a specific phase* is a bad bad pattern, and it's a good
> > > thing
> > >> that Maven does not let you do that.
> > >>
> > >> If you need to do a pile of every-so-often tasks I'd define them in
> > > profiles
> > >> with each profile attaching the plugins to the requisite phases and
> > > defining
> > >> the defaultGoals to the highest phase necessary.
> > >>
> > >>
> > >>> The curly braces already seem to be associated with execution ids
> in
> > >>> maven's logging output. This would mean that components.xml file
> in
> > > maven
> > >>> core could be changed to provide execution IDs for each plugin
> that
> > > is
> > >>> executed, but probably no one wants to manually update this all
> the
> > > time.
> > >>> IMO the wildcard syntax is more than what is needed, and will make
> > > the pom
> > >>> a little less readable. The choice should be configure all
> > > executions or
> > >>> just one, otherwise it starts getting too complicated.
> > >>>
> > >>> After looking into the current behavior a little more, it is
> > possible
> > > to
> > >>> execute the same plugin goal twice in the same phase. So I think
> > all
> > > the
> > >>> naming schemes proposed except maybe Brett's
> > >>> (groupId:artifactId:sequenceNumber) could run into conflicts in
> the
> > > future.
> > >>> But if we include a sequence number, then what happens if you add
> > > another
> > >>> execution of an existing plugin to the lifecycle? Do all the
> > > sequence
> > >>> numbers have to increment to make room?
> > >>>
> > >> Plus sequence number is non-deterministic. Also, you are
> > > forgetting... this
> > >> is not the id of executions *defined within the pom* but it's the
> id
> > > of
> > >> executions *defined by either the lifecycle or the plugin's mojo
> > > bindings*
> > >> I don't see how a mojo's descriptor can bind to any more than one
> > > phase, so
> > >> I guess the only thing preventing uniqueness is if the lifecycle
> can
> > > invoke
> > >> the same goal multiple times in the same phase... but hang on, how
> is
> > > that a
> > >> problem if we say that the execution is per phase (unless you want
> to
> > >> configure the different multiple executions differentially....
> sounds
> > > like
> > >> you're writing a severe hack)
> > >>
> > >
> > > I just said that sequence numbers are the only way suggested that
> > > completely
> > > avoid id conflicts, but you're right it has other problems.
> > >
> > > I don't think it's a severe hack to have two executions for the same
> > > plugin goal
> > > in the same phase. For example, let's say I want to generate three
> > jar
> > > files
> > > with different manifests during the package phase. I need to call
> the
> > > assembly
> > > or jar plugin three times with different configurations. I'm just
> > > saying it's
> > > possible to have this scenario even in a default lifecycle, so there
> > is
> > > a small
> > > possibility of a name conflict even if we use something like
> > > lifecycle-<packaging>-<phase>-<plugin>-<goal>
> > >
> > >>> I think if we add the goal name to the execution like Benjamin
> > > suggested,
> > >>> we will be unlikely to run into conflicts. So I would prefer
> > > something
> > >>> like:
> > >>>
> > >>> default-lifecycle-compile
> > >>> default-lifecycle-testCompile
> > >>>
> > >> No, what if I bind compile goal to the compile phase and
> > > process-classes?
> > >> Now I have an execution that is bound to two phases (not allowed)
> or
> > > two
> > >> executions with the same id (not allowed)
> > >>
> > >> I'm sorry, but I don't see how you can exclude the phase from the
> > >> execution's id...
> > >>
> > >> And given that phases consist of names separated by -, it seems
> > > confusing to
> > >> name them with - as a separator.
> > >>
> > >
> > > Adding the phase to the ID doesn't prevent name conflicts, since you
> > can
> > > have
> > > the same goal twice in the same phase. I would guess it's actually
> be
> > > more
> > > common to have a goal twice in the same phase vs. in different
> phases.
> > > So I
> > > think the goal name is a better qualifier than the phase.
> > >
> > >> Now I don't mind if we do
> > >>
> > >> default-lifecycle:compile
> > >> default-lifecycle:test-compile
> > >>
> > >> or
> > >>
> > >> lifecycle:compile
> > >> lifecycle:test-compile
> > >>
> > >> or
> > >>
> > >> lifecycle:jar:compile
> > >> lifecycle:jar:test-compile
> > >>
> > >> or even use a different separator ('/' anyone?)
> > >>
> > >> The only advantage of specifying the packaging type is if you have
> a
> > > common
> > >> root pom. Wildcards only become really important if you use
> > packaging
> > > in
> > >> the id, but there is still the issue of what if I need to specify
> > > something
> > >> for all executions (but keep the defaults outside of an execution
> > > different
> > >> for when executing goals directly from the command line)
> > >>
> > >> I can live without wildcards.
> > >>
> > >> Sequence numbers are either non-deterministic, or will end up
> having
> > a
> > > 1:1
> > >> mapping with each phase, so why not just use the phase. Goal is
> > > non-unique,
> > >> and has the problem of multiple executions, and we can likely get
> > away
> > > with
> > >> just phase anyway.
> > >>
> > >>
> > >>> When building, this logs to the command line like this:
> > >>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
> > >>>
> > >>>
> > >>>
> > ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >>> For additional commands, e-mail: dev-help@maven.apache.org
> > >>>
> > >>>
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Well now you've crossed over to http://jira.codehaus.org/browse/MNG-3203
which is a separate issue imo.
-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
Sent: Monday, November 10, 2008 4:41 PM
To: Maven Developers List
Subject: Re: Default plugin execution id
We need to split out the different executions somehow.
If we use a sequence number:
1. How do I deterministically know what sequence number to use?
2. What happens when a newer version of the lifecycle introduces an
earlier
execution?
On my count, that leaves a sequence number nearly dead
If we use the goal name:
1. What happens if the goal appears more than once? (OK, so coming from
the
lifecycle, this is likely not too big an issue as the lifecycle will not
allow differential configuration of the same goal executed twice... but
it
may be that the mojo infers things from the reactor / or updates to the
Maven project... for example we may want to enforce some things at the
start
and then enforce more things at a later phase)
The only thing that we know occurs only once is the phase...
The down-side of the phase is multiple executions in the one phase would
share the same configuration.
-Stephen
2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
> I don't see how phase is really needed. It applies to only two plugins
> that I can think of, compiler and resources, and this is a bigger
> problem for a 3.x timeframe. I think that something simple can cover
90%
> of the cases and be doable in 2.x
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 4:05 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Yes, you're right, I think this is getting more complicated that it
> needs to be.
> Either of these is fine with me:
> default-lifecycle:goal
> or
> default-lifecycle:phase
>
> Either of them should be pretty easy to implement, and pretty unlikely
> to cause
> any new problems. If we just use default by itself, then we don't
> resolve
> compile/testCompile or other similar situations.
>
> Brian E. Fox wrote:
> > I think we've gone way off the rails here. I see there's a proposal
> but
> > haven't reviewed it yet.
> >
> > The first portion of this discussion was rather small in scope:
> > Currently default executions of plugins have a null id. The null is
> used
> > to indicate the default config for a plugin across all executions
AND
> is
> > used for lifecycle bound or plugins run on the cli. I think we
simply
> > should start by separating this. Keep default to replace the current
> > null values for the global plugin configuration as it applies across
> all
> > executions. Then define an id for the lifecycle and cli invocations
to
> > be applied to tweak the values as needed (but keeping default to
apply
> > across all). Going beyond this into multifaceted ids for packages
etc
> is
> > far too complicated imo.
> >
> > -----Original Message-----
> > From: Paul Gier [mailto:pgier@redhat.com]
> > Sent: Monday, November 10, 2008 3:44 PM
> > To: Maven Developers List
> > Subject: Re: Default plugin execution id
> >
> > Stephen Connolly wrote:
> >> 2008/11/10 Paul Gier <pg...@redhat.com>
> >>
> >>> What about adding new syntax to the goal string? So that from the
> > command
> >>> line you could write something like this to refer to specific
> > execution
> >>> configs:
> >>>
> >>> mvn eclipse:eclipse{execution-1}
> >>> or
> >>> mvn eclipse:eclipse{execution-2}
> >>>
> >> How would that interact with the lifecycle?
> >>
> >> If I define execution-1 as attached to the compile phase, does that
> > mean
> >> that Maven will execute all phases upto compile and then just
execute
> >> eclipse:eclipse, or is it just executing eclipse:eclipse and
ignoring
> > any
> >> plugins that are attached to prior phases? (With the side effect
that
> > I'd
> >> loose the information of the extra attached source directories)
> >>
> >> The more I think about it, calling out a specific execution *that
has
> > been
> >> attached to a specific phase* is a bad bad pattern, and it's a good
> > thing
> >> that Maven does not let you do that.
> >>
> >> If you need to do a pile of every-so-often tasks I'd define them in
> > profiles
> >> with each profile attaching the plugins to the requisite phases and
> > defining
> >> the defaultGoals to the highest phase necessary.
> >>
> >>
> >>> The curly braces already seem to be associated with execution ids
in
> >>> maven's logging output. This would mean that components.xml file
in
> > maven
> >>> core could be changed to provide execution IDs for each plugin
that
> > is
> >>> executed, but probably no one wants to manually update this all
the
> > time.
> >>> IMO the wildcard syntax is more than what is needed, and will make
> > the pom
> >>> a little less readable. The choice should be configure all
> > executions or
> >>> just one, otherwise it starts getting too complicated.
> >>>
> >>> After looking into the current behavior a little more, it is
> possible
> > to
> >>> execute the same plugin goal twice in the same phase. So I think
> all
> > the
> >>> naming schemes proposed except maybe Brett's
> >>> (groupId:artifactId:sequenceNumber) could run into conflicts in
the
> > future.
> >>> But if we include a sequence number, then what happens if you add
> > another
> >>> execution of an existing plugin to the lifecycle? Do all the
> > sequence
> >>> numbers have to increment to make room?
> >>>
> >> Plus sequence number is non-deterministic. Also, you are
> > forgetting... this
> >> is not the id of executions *defined within the pom* but it's the
id
> > of
> >> executions *defined by either the lifecycle or the plugin's mojo
> > bindings*
> >> I don't see how a mojo's descriptor can bind to any more than one
> > phase, so
> >> I guess the only thing preventing uniqueness is if the lifecycle
can
> > invoke
> >> the same goal multiple times in the same phase... but hang on, how
is
> > that a
> >> problem if we say that the execution is per phase (unless you want
to
> >> configure the different multiple executions differentially....
sounds
> > like
> >> you're writing a severe hack)
> >>
> >
> > I just said that sequence numbers are the only way suggested that
> > completely
> > avoid id conflicts, but you're right it has other problems.
> >
> > I don't think it's a severe hack to have two executions for the same
> > plugin goal
> > in the same phase. For example, let's say I want to generate three
> jar
> > files
> > with different manifests during the package phase. I need to call
the
> > assembly
> > or jar plugin three times with different configurations. I'm just
> > saying it's
> > possible to have this scenario even in a default lifecycle, so there
> is
> > a small
> > possibility of a name conflict even if we use something like
> > lifecycle-<packaging>-<phase>-<plugin>-<goal>
> >
> >>> I think if we add the goal name to the execution like Benjamin
> > suggested,
> >>> we will be unlikely to run into conflicts. So I would prefer
> > something
> >>> like:
> >>>
> >>> default-lifecycle-compile
> >>> default-lifecycle-testCompile
> >>>
> >> No, what if I bind compile goal to the compile phase and
> > process-classes?
> >> Now I have an execution that is bound to two phases (not allowed)
or
> > two
> >> executions with the same id (not allowed)
> >>
> >> I'm sorry, but I don't see how you can exclude the phase from the
> >> execution's id...
> >>
> >> And given that phases consist of names separated by -, it seems
> > confusing to
> >> name them with - as a separator.
> >>
> >
> > Adding the phase to the ID doesn't prevent name conflicts, since you
> can
> > have
> > the same goal twice in the same phase. I would guess it's actually
be
> > more
> > common to have a goal twice in the same phase vs. in different
phases.
> > So I
> > think the goal name is a better qualifier than the phase.
> >
> >> Now I don't mind if we do
> >>
> >> default-lifecycle:compile
> >> default-lifecycle:test-compile
> >>
> >> or
> >>
> >> lifecycle:compile
> >> lifecycle:test-compile
> >>
> >> or
> >>
> >> lifecycle:jar:compile
> >> lifecycle:jar:test-compile
> >>
> >> or even use a different separator ('/' anyone?)
> >>
> >> The only advantage of specifying the packaging type is if you have
a
> > common
> >> root pom. Wildcards only become really important if you use
> packaging
> > in
> >> the id, but there is still the issue of what if I need to specify
> > something
> >> for all executions (but keep the defaults outside of an execution
> > different
> >> for when executing goals directly from the command line)
> >>
> >> I can live without wildcards.
> >>
> >> Sequence numbers are either non-deterministic, or will end up
having
> a
> > 1:1
> >> mapping with each phase, so why not just use the phase. Goal is
> > non-unique,
> >> and has the problem of multiple executions, and we can likely get
> away
> > with
> >> just phase anyway.
> >>
> >>
> >>> When building, this logs to the command line like this:
> >>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
> >>>
> >>>
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>
> >>>
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
We need to split out the different executions somehow.
If we use a sequence number:
1. How do I deterministically know what sequence number to use?
2. What happens when a newer version of the lifecycle introduces an earlier
execution?
On my count, that leaves a sequence number nearly dead
If we use the goal name:
1. What happens if the goal appears more than once? (OK, so coming from the
lifecycle, this is likely not too big an issue as the lifecycle will not
allow differential configuration of the same goal executed twice... but it
may be that the mojo infers things from the reactor / or updates to the
Maven project... for example we may want to enforce some things at the start
and then enforce more things at a later phase)
The only thing that we know occurs only once is the phase...
The down-side of the phase is multiple executions in the one phase would
share the same configuration.
-Stephen
2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
> I don't see how phase is really needed. It applies to only two plugins
> that I can think of, compiler and resources, and this is a bigger
> problem for a 3.x timeframe. I think that something simple can cover 90%
> of the cases and be doable in 2.x
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 4:05 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Yes, you're right, I think this is getting more complicated that it
> needs to be.
> Either of these is fine with me:
> default-lifecycle:goal
> or
> default-lifecycle:phase
>
> Either of them should be pretty easy to implement, and pretty unlikely
> to cause
> any new problems. If we just use default by itself, then we don't
> resolve
> compile/testCompile or other similar situations.
>
> Brian E. Fox wrote:
> > I think we've gone way off the rails here. I see there's a proposal
> but
> > haven't reviewed it yet.
> >
> > The first portion of this discussion was rather small in scope:
> > Currently default executions of plugins have a null id. The null is
> used
> > to indicate the default config for a plugin across all executions AND
> is
> > used for lifecycle bound or plugins run on the cli. I think we simply
> > should start by separating this. Keep default to replace the current
> > null values for the global plugin configuration as it applies across
> all
> > executions. Then define an id for the lifecycle and cli invocations to
> > be applied to tweak the values as needed (but keeping default to apply
> > across all). Going beyond this into multifaceted ids for packages etc
> is
> > far too complicated imo.
> >
> > -----Original Message-----
> > From: Paul Gier [mailto:pgier@redhat.com]
> > Sent: Monday, November 10, 2008 3:44 PM
> > To: Maven Developers List
> > Subject: Re: Default plugin execution id
> >
> > Stephen Connolly wrote:
> >> 2008/11/10 Paul Gier <pg...@redhat.com>
> >>
> >>> What about adding new syntax to the goal string? So that from the
> > command
> >>> line you could write something like this to refer to specific
> > execution
> >>> configs:
> >>>
> >>> mvn eclipse:eclipse{execution-1}
> >>> or
> >>> mvn eclipse:eclipse{execution-2}
> >>>
> >> How would that interact with the lifecycle?
> >>
> >> If I define execution-1 as attached to the compile phase, does that
> > mean
> >> that Maven will execute all phases upto compile and then just execute
> >> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring
> > any
> >> plugins that are attached to prior phases? (With the side effect that
> > I'd
> >> loose the information of the extra attached source directories)
> >>
> >> The more I think about it, calling out a specific execution *that has
> > been
> >> attached to a specific phase* is a bad bad pattern, and it's a good
> > thing
> >> that Maven does not let you do that.
> >>
> >> If you need to do a pile of every-so-often tasks I'd define them in
> > profiles
> >> with each profile attaching the plugins to the requisite phases and
> > defining
> >> the defaultGoals to the highest phase necessary.
> >>
> >>
> >>> The curly braces already seem to be associated with execution ids in
> >>> maven's logging output. This would mean that components.xml file in
> > maven
> >>> core could be changed to provide execution IDs for each plugin that
> > is
> >>> executed, but probably no one wants to manually update this all the
> > time.
> >>> IMO the wildcard syntax is more than what is needed, and will make
> > the pom
> >>> a little less readable. The choice should be configure all
> > executions or
> >>> just one, otherwise it starts getting too complicated.
> >>>
> >>> After looking into the current behavior a little more, it is
> possible
> > to
> >>> execute the same plugin goal twice in the same phase. So I think
> all
> > the
> >>> naming schemes proposed except maybe Brett's
> >>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> > future.
> >>> But if we include a sequence number, then what happens if you add
> > another
> >>> execution of an existing plugin to the lifecycle? Do all the
> > sequence
> >>> numbers have to increment to make room?
> >>>
> >> Plus sequence number is non-deterministic. Also, you are
> > forgetting... this
> >> is not the id of executions *defined within the pom* but it's the id
> > of
> >> executions *defined by either the lifecycle or the plugin's mojo
> > bindings*
> >> I don't see how a mojo's descriptor can bind to any more than one
> > phase, so
> >> I guess the only thing preventing uniqueness is if the lifecycle can
> > invoke
> >> the same goal multiple times in the same phase... but hang on, how is
> > that a
> >> problem if we say that the execution is per phase (unless you want to
> >> configure the different multiple executions differentially.... sounds
> > like
> >> you're writing a severe hack)
> >>
> >
> > I just said that sequence numbers are the only way suggested that
> > completely
> > avoid id conflicts, but you're right it has other problems.
> >
> > I don't think it's a severe hack to have two executions for the same
> > plugin goal
> > in the same phase. For example, let's say I want to generate three
> jar
> > files
> > with different manifests during the package phase. I need to call the
> > assembly
> > or jar plugin three times with different configurations. I'm just
> > saying it's
> > possible to have this scenario even in a default lifecycle, so there
> is
> > a small
> > possibility of a name conflict even if we use something like
> > lifecycle-<packaging>-<phase>-<plugin>-<goal>
> >
> >>> I think if we add the goal name to the execution like Benjamin
> > suggested,
> >>> we will be unlikely to run into conflicts. So I would prefer
> > something
> >>> like:
> >>>
> >>> default-lifecycle-compile
> >>> default-lifecycle-testCompile
> >>>
> >> No, what if I bind compile goal to the compile phase and
> > process-classes?
> >> Now I have an execution that is bound to two phases (not allowed) or
> > two
> >> executions with the same id (not allowed)
> >>
> >> I'm sorry, but I don't see how you can exclude the phase from the
> >> execution's id...
> >>
> >> And given that phases consist of names separated by -, it seems
> > confusing to
> >> name them with - as a separator.
> >>
> >
> > Adding the phase to the ID doesn't prevent name conflicts, since you
> can
> > have
> > the same goal twice in the same phase. I would guess it's actually be
> > more
> > common to have a goal twice in the same phase vs. in different phases.
> > So I
> > think the goal name is a better qualifier than the phase.
> >
> >> Now I don't mind if we do
> >>
> >> default-lifecycle:compile
> >> default-lifecycle:test-compile
> >>
> >> or
> >>
> >> lifecycle:compile
> >> lifecycle:test-compile
> >>
> >> or
> >>
> >> lifecycle:jar:compile
> >> lifecycle:jar:test-compile
> >>
> >> or even use a different separator ('/' anyone?)
> >>
> >> The only advantage of specifying the packaging type is if you have a
> > common
> >> root pom. Wildcards only become really important if you use
> packaging
> > in
> >> the id, but there is still the issue of what if I need to specify
> > something
> >> for all executions (but keep the defaults outside of an execution
> > different
> >> for when executing goals directly from the command line)
> >>
> >> I can live without wildcards.
> >>
> >> Sequence numbers are either non-deterministic, or will end up having
> a
> > 1:1
> >> mapping with each phase, so why not just use the phase. Goal is
> > non-unique,
> >> and has the problem of multiple executions, and we can likely get
> away
> > with
> >> just phase anyway.
> >>
> >>
> >>> When building, this logs to the command line like this:
> >>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
> >>>
> >>>
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>
> >>>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Paul Gier <pg...@redhat.com>
> Stephen Connolly wrote:
>
>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>
>> Plus sequence number is non-deterministic. Also, you are forgetting...
>> this
>> is not the id of executions *defined within the pom* but it's the id of
>> executions *defined by either the lifecycle or the plugin's mojo bindings*
>>
>> I don't see how a mojo's descriptor can bind to any more than one phase,
>> so
>> I guess the only thing preventing uniqueness is if the lifecycle can
>> invoke
>> the same goal multiple times in the same phase... but hang on, how is that
>> a
>> problem if we say that the execution is per phase (unless you want to
>> configure the different multiple executions differentially.... sounds like
>> you're writing a severe hack)
>>
>>
> I just said that sequence numbers are the only way suggested that
> completely avoid id conflicts, but you're right it has other problems.
>
> I don't think it's a severe hack to have two executions for the same plugin
> goal in the same phase. For example, let's say I want to generate three jar
> files with different manifests during the package phase. I need to call the
> assembly or jar plugin three times with different configurations. I'm just
> saying it's possible to have this scenario even in a default lifecycle, so
> there is a small possibility of a name conflict even if we use something
> like
> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
>
>> I think if we add the goal name to the execution like Benjamin suggested,
>>> we will be unlikely to run into conflicts. So I would prefer something
>>> like:
>>>
>>> default-lifecycle-compile
>>> default-lifecycle-testCompile
>>>
>>>
>> No, what if I bind compile goal to the compile phase and process-classes?
>>
>> Now I have an execution that is bound to two phases (not allowed) or two
>> executions with the same id (not allowed)
>>
>> I'm sorry, but I don't see how you can exclude the phase from the
>> execution's id...
>>
>> And given that phases consist of names separated by -, it seems confusing
>> to
>> name them with - as a separator.
>>
>>
> Adding the phase to the ID doesn't prevent name conflicts, since you can
> have the same goal twice in the same phase. I would guess it's actually be
> more common to have a goal twice in the same phase vs. in different phases.
> So I think the goal name is a better qualifier than the phase.
>
Remember, these are the executions that are introduced *through the
lifecycle*
At present, AFAIK, the lifecycle does not provide a means to configure the
same goal differentially, so if you define your own packaging: (e.g.
threejars) and bind jar:jar to the packaging phase three times, they will
all have exactly the same configuration.
We are not talking about executions that are added to the pom, we are
talking about executions coming from the lifecycle.
>
>
> Now I don't mind if we do
>>
>> default-lifecycle:compile
>> default-lifecycle:test-compile
>>
>> or
>>
>> lifecycle:compile
>> lifecycle:test-compile
>>
>> or
>>
>> lifecycle:jar:compile
>> lifecycle:jar:test-compile
>>
>> or even use a different separator ('/' anyone?)
>>
>> The only advantage of specifying the packaging type is if you have a
>> common
>> root pom. Wildcards only become really important if you use packaging in
>> the id, but there is still the issue of what if I need to specify
>> something
>> for all executions (but keep the defaults outside of an execution
>> different
>> for when executing goals directly from the command line)
>>
>> I can live without wildcards.
>>
>> Sequence numbers are either non-deterministic, or will end up having a 1:1
>> mapping with each phase, so why not just use the phase. Goal is
>> non-unique,
>> and has the problem of multiple executions, and we can likely get away
>> with
>> just phase anyway.
>>
>>
>> When building, this logs to the command line like this:
>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Paul Gier <pg...@redhat.com>
> Stephen Connolly wrote:
>
>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>
>> What about adding new syntax to the goal string? So that from the
>>> command
>>> line you could write something like this to refer to specific execution
>>> configs:
>>>
>>> mvn eclipse:eclipse{execution-1}
>>> or
>>> mvn eclipse:eclipse{execution-2}
>>>
>>>
>> How would that interact with the lifecycle?
>>
>> If I define execution-1 as attached to the compile phase, does that mean
>> that Maven will execute all phases upto compile and then just execute
>> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring any
>> plugins that are attached to prior phases? (With the side effect that I'd
>> loose the information of the extra attached source directories)
>>
>> The more I think about it, calling out a specific execution *that has been
>> attached to a specific phase* is a bad bad pattern, and it's a good thing
>> that Maven does not let you do that.
>>
>> If you need to do a pile of every-so-often tasks I'd define them in
>> profiles
>> with each profile attaching the plugins to the requisite phases and
>> defining
>> the defaultGoals to the highest phase necessary.
>>
>>
>>
> I was imagining that the interaction with the phases wouldn't change from
> how it is now. For example:
>
> mvn eclipse:eclipse{execution-1}
>
> This would behave the same way it does now (calls the genereate-resources
> phase then the eclipse goal) except that it would look for relevant
> configuration in execution-1. And of course merge that with the global
> plugin config.
> But it would ignore the phase and goals settings of the execution.
>
Ahh, no what eclipse:eclipse does currently is that it forkes the build to
call the lifecycle up to generate-sources (or is it generate-test-sources)
This is why I think eclipse:eclipse is a *bad example*
A better example is the compiler plugin.
If we had lifecycle:<phase> or lifecycle:<packaging>:<phase> we would not
need separate goals for compile and test-compile (of course we have the
minor problem of how to specify in the lifecycle that when bound to
test-compile we use different source and output dirs)
If you execute mvn compiler:compile outside of the lifecycle on a project
that generates sources you'll see why context becomes important.
>
>
> The curly braces already seem to be associated with execution ids in
>>> maven's logging output. This would mean that components.xml file in
>>> maven
>>> core could be changed to provide execution IDs for each plugin that is
>>> executed, but probably no one wants to manually update this all the time.
>>>
>>> IMO the wildcard syntax is more than what is needed, and will make the
>>> pom
>>> a little less readable. The choice should be configure all executions or
>>> just one, otherwise it starts getting too complicated.
>>>
>>> After looking into the current behavior a little more, it is possible to
>>> execute the same plugin goal twice in the same phase. So I think all the
>>> naming schemes proposed except maybe Brett's
>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
>>> future.
>>> But if we include a sequence number, then what happens if you add
>>> another
>>> execution of an existing plugin to the lifecycle? Do all the sequence
>>> numbers have to increment to make room?
>>>
>>>
>> Plus sequence number is non-deterministic. Also, you are forgetting...
>> this
>> is not the id of executions *defined within the pom* but it's the id of
>> executions *defined by either the lifecycle or the plugin's mojo bindings*
>>
>> I don't see how a mojo's descriptor can bind to any more than one phase,
>> so
>> I guess the only thing preventing uniqueness is if the lifecycle can
>> invoke
>> the same goal multiple times in the same phase... but hang on, how is that
>> a
>> problem if we say that the execution is per phase (unless you want to
>> configure the different multiple executions differentially.... sounds like
>> you're writing a severe hack)
>>
>>
>> I think if we add the goal name to the execution like Benjamin suggested,
>>> we will be unlikely to run into conflicts. So I would prefer something
>>> like:
>>>
>>> default-lifecycle-compile
>>> default-lifecycle-testCompile
>>>
>>>
>> No, what if I bind compile goal to the compile phase and process-classes?
>>
>> Now I have an execution that is bound to two phases (not allowed) or two
>> executions with the same id (not allowed)
>>
>> I'm sorry, but I don't see how you can exclude the phase from the
>> execution's id...
>>
>> And given that phases consist of names separated by -, it seems confusing
>> to
>> name them with - as a separator.
>>
>> Now I don't mind if we do
>>
>> default-lifecycle:compile
>> default-lifecycle:test-compile
>>
>> or
>>
>> lifecycle:compile
>> lifecycle:test-compile
>>
>> or
>>
>> lifecycle:jar:compile
>> lifecycle:jar:test-compile
>>
>> or even use a different separator ('/' anyone?)
>>
>> The only advantage of specifying the packaging type is if you have a
>> common
>> root pom. Wildcards only become really important if you use packaging in
>> the id, but there is still the issue of what if I need to specify
>> something
>> for all executions (but keep the defaults outside of an execution
>> different
>> for when executing goals directly from the command line)
>>
>> I can live without wildcards.
>>
>> Sequence numbers are either non-deterministic, or will end up having a 1:1
>> mapping with each phase, so why not just use the phase. Goal is
>> non-unique,
>> and has the problem of multiple executions, and we can likely get away
>> with
>> just phase anyway.
>>
>>
>> When building, this logs to the command line like this:
>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
Sorry the mail got sent too early
2008/11/10 Stephen Connolly <st...@gmail.com>
> What if I do
>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <executions>
> <execution>
> <id>default-lifecycle:testCompile</id>
> <phase>pre-integration-test</phase>
> </execution>
>
Now when we get emails on the list asking why no tests are run during the
test phase (because they were not compiled) it is not quite so obvious what
they've done wrong...
if we use the phase in defining the execution, it becomes more obvious:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-lifecycle:test-compile</id>
<phase>pre-integration-test</phase>
...
</execution>
I'm specifically moving an execution from the test-compile phase to the
pre-integration-test phase.
Additionally, if I specify the goals, I can override what goals get executed
during that phase... providing a route to debind an execution from a phase.
-Stephen
>
>
> 2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
>
> Again, why? It's not possible now so it's obviously working for most
>> cases today.
>>
>> -----Original Message-----
>> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
>> Sent: Monday, November 10, 2008 4:27 PM
>> To: Maven Developers List
>> Cc: Maven Developers List
>> Subject: Re: Default plugin execution id
>>
>> well you need to separate out the executions by phase in case somebody
>> decided to change the phase specified in the execution
>>
>> Sent from my iPod
>>
>> On 10 Nov 2008, at 21:29, "Brian E. Fox" <br...@reply.infinity.nu>
>> wrote:
>>
>> > I don't see how phase is really needed. It applies to only two plugins
>> > that I can think of, compiler and resources, and this is a bigger
>> > problem for a 3.x timeframe. I think that something simple can cover
>> > 90%
>> > of the cases and be doable in 2.x
>> >
>> >
>> > -----Original Message-----
>> > From: Paul Gier [mailto:pgier@redhat.com]
>> > Sent: Monday, November 10, 2008 4:05 PM
>> > To: Maven Developers List
>> > Subject: Re: Default plugin execution id
>> >
>> > Yes, you're right, I think this is getting more complicated that it
>> > needs to be.
>> > Either of these is fine with me:
>> > default-lifecycle:goal
>> > or
>> > default-lifecycle:phase
>> >
>> > Either of them should be pretty easy to implement, and pretty unlikely
>> > to cause
>> > any new problems. If we just use default by itself, then we don't
>> > resolve
>> > compile/testCompile or other similar situations.
>> >
>> > Brian E. Fox wrote:
>> >> I think we've gone way off the rails here. I see there's a proposal
>> > but
>> >> haven't reviewed it yet.
>> >>
>> >> The first portion of this discussion was rather small in scope:
>> >> Currently default executions of plugins have a null id. The null is
>> > used
>> >> to indicate the default config for a plugin across all executions AND
>> > is
>> >> used for lifecycle bound or plugins run on the cli. I think we simply
>> >> should start by separating this. Keep default to replace the current
>> >> null values for the global plugin configuration as it applies across
>> > all
>> >> executions. Then define an id for the lifecycle and cli invocations
>> >> to
>> >> be applied to tweak the values as needed (but keeping default to
>> >> apply
>> >> across all). Going beyond this into multifaceted ids for packages etc
>> > is
>> >> far too complicated imo.
>> >>
>> >> -----Original Message-----
>> >> From: Paul Gier [mailto:pgier@redhat.com]
>> >> Sent: Monday, November 10, 2008 3:44 PM
>> >> To: Maven Developers List
>> >> Subject: Re: Default plugin execution id
>> >>
>> >> Stephen Connolly wrote:
>> >>> 2008/11/10 Paul Gier <pg...@redhat.com>
>> >>>
>> >>>> What about adding new syntax to the goal string? So that from the
>> >> command
>> >>>> line you could write something like this to refer to specific
>> >> execution
>> >>>> configs:
>> >>>>
>> >>>> mvn eclipse:eclipse{execution-1}
>> >>>> or
>> >>>> mvn eclipse:eclipse{execution-2}
>> >>>>
>> >>> How would that interact with the lifecycle?
>> >>>
>> >>> If I define execution-1 as attached to the compile phase, does that
>> >> mean
>> >>> that Maven will execute all phases upto compile and then just
>> >>> execute
>> >>> eclipse:eclipse, or is it just executing eclipse:eclipse and
>> >>> ignoring
>> >> any
>> >>> plugins that are attached to prior phases? (With the side effect
>> >>> that
>> >> I'd
>> >>> loose the information of the extra attached source directories)
>> >>>
>> >>> The more I think about it, calling out a specific execution *that
>> >>> has
>> >> been
>> >>> attached to a specific phase* is a bad bad pattern, and it's a good
>> >> thing
>> >>> that Maven does not let you do that.
>> >>>
>> >>> If you need to do a pile of every-so-often tasks I'd define them in
>> >> profiles
>> >>> with each profile attaching the plugins to the requisite phases and
>> >> defining
>> >>> the defaultGoals to the highest phase necessary.
>> >>>
>> >>>
>> >>>> The curly braces already seem to be associated with execution ids
>> >>>> in
>> >>>> maven's logging output. This would mean that components.xml file
>> >>>> in
>> >> maven
>> >>>> core could be changed to provide execution IDs for each plugin that
>> >> is
>> >>>> executed, but probably no one wants to manually update this all the
>> >> time.
>> >>>> IMO the wildcard syntax is more than what is needed, and will make
>> >> the pom
>> >>>> a little less readable. The choice should be configure all
>> >> executions or
>> >>>> just one, otherwise it starts getting too complicated.
>> >>>>
>> >>>> After looking into the current behavior a little more, it is
>> > possible
>> >> to
>> >>>> execute the same plugin goal twice in the same phase. So I think
>> > all
>> >> the
>> >>>> naming schemes proposed except maybe Brett's
>> >>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
>> >> future.
>> >>>> But if we include a sequence number, then what happens if you add
>> >> another
>> >>>> execution of an existing plugin to the lifecycle? Do all the
>> >> sequence
>> >>>> numbers have to increment to make room?
>> >>>>
>> >>> Plus sequence number is non-deterministic. Also, you are
>> >> forgetting... this
>> >>> is not the id of executions *defined within the pom* but it's the id
>> >> of
>> >>> executions *defined by either the lifecycle or the plugin's mojo
>> >> bindings*
>> >>> I don't see how a mojo's descriptor can bind to any more than one
>> >> phase, so
>> >>> I guess the only thing preventing uniqueness is if the lifecycle can
>> >> invoke
>> >>> the same goal multiple times in the same phase... but hang on, how
>> >>> is
>> >> that a
>> >>> problem if we say that the execution is per phase (unless you want
>> >>> to
>> >>> configure the different multiple executions differentially....
>> >>> sounds
>> >> like
>> >>> you're writing a severe hack)
>> >>>
>> >>
>> >> I just said that sequence numbers are the only way suggested that
>> >> completely
>> >> avoid id conflicts, but you're right it has other problems.
>> >>
>> >> I don't think it's a severe hack to have two executions for the same
>> >> plugin goal
>> >> in the same phase. For example, let's say I want to generate three
>> > jar
>> >> files
>> >> with different manifests during the package phase. I need to call
>> >> the
>> >> assembly
>> >> or jar plugin three times with different configurations. I'm just
>> >> saying it's
>> >> possible to have this scenario even in a default lifecycle, so there
>> > is
>> >> a small
>> >> possibility of a name conflict even if we use something like
>> >> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>> >>
>> >>>> I think if we add the goal name to the execution like Benjamin
>> >> suggested,
>> >>>> we will be unlikely to run into conflicts. So I would prefer
>> >> something
>> >>>> like:
>> >>>>
>> >>>> default-lifecycle-compile
>> >>>> default-lifecycle-testCompile
>> >>>>
>> >>> No, what if I bind compile goal to the compile phase and
>> >> process-classes?
>> >>> Now I have an execution that is bound to two phases (not allowed) or
>> >> two
>> >>> executions with the same id (not allowed)
>> >>>
>> >>> I'm sorry, but I don't see how you can exclude the phase from the
>> >>> execution's id...
>> >>>
>> >>> And given that phases consist of names separated by -, it seems
>> >> confusing to
>> >>> name them with - as a separator.
>> >>>
>> >>
>> >> Adding the phase to the ID doesn't prevent name conflicts, since you
>> > can
>> >> have
>> >> the same goal twice in the same phase. I would guess it's actually
>> >> be
>> >> more
>> >> common to have a goal twice in the same phase vs. in different
>> >> phases.
>> >> So I
>> >> think the goal name is a better qualifier than the phase.
>> >>
>> >>> Now I don't mind if we do
>> >>>
>> >>> default-lifecycle:compile
>> >>> default-lifecycle:test-compile
>> >>>
>> >>> or
>> >>>
>> >>> lifecycle:compile
>> >>> lifecycle:test-compile
>> >>>
>> >>> or
>> >>>
>> >>> lifecycle:jar:compile
>> >>> lifecycle:jar:test-compile
>> >>>
>> >>> or even use a different separator ('/' anyone?)
>> >>>
>> >>> The only advantage of specifying the packaging type is if you have a
>> >> common
>> >>> root pom. Wildcards only become really important if you use
>> > packaging
>> >> in
>> >>> the id, but there is still the issue of what if I need to specify
>> >> something
>> >>> for all executions (but keep the defaults outside of an execution
>> >> different
>> >>> for when executing goals directly from the command line)
>> >>>
>> >>> I can live without wildcards.
>> >>>
>> >>> Sequence numbers are either non-deterministic, or will end up having
>> > a
>> >> 1:1
>> >>> mapping with each phase, so why not just use the phase. Goal is
>> >> non-unique,
>> >>> and has the problem of multiple executions, and we can likely get
>> > away
>> >> with
>> >>> just phase anyway.
>> >>>
>> >>>
>> >>>> When building, this logs to the command line like this:
>> >>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>> >>>>
>> >>>>
>> >>>>
>> > ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >>>> For additional commands, e-mail: dev-help@maven.apache.org
>> >>>>
>> >>>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
What if I do
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-lifecycle:testCompile</id>
<phase>pre-integration-test</phase>
</execution>
2008/11/10 Brian E. Fox <br...@reply.infinity.nu>
> Again, why? It's not possible now so it's obviously working for most
> cases today.
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
> Sent: Monday, November 10, 2008 4:27 PM
> To: Maven Developers List
> Cc: Maven Developers List
> Subject: Re: Default plugin execution id
>
> well you need to separate out the executions by phase in case somebody
> decided to change the phase specified in the execution
>
> Sent from my iPod
>
> On 10 Nov 2008, at 21:29, "Brian E. Fox" <br...@reply.infinity.nu>
> wrote:
>
> > I don't see how phase is really needed. It applies to only two plugins
> > that I can think of, compiler and resources, and this is a bigger
> > problem for a 3.x timeframe. I think that something simple can cover
> > 90%
> > of the cases and be doable in 2.x
> >
> >
> > -----Original Message-----
> > From: Paul Gier [mailto:pgier@redhat.com]
> > Sent: Monday, November 10, 2008 4:05 PM
> > To: Maven Developers List
> > Subject: Re: Default plugin execution id
> >
> > Yes, you're right, I think this is getting more complicated that it
> > needs to be.
> > Either of these is fine with me:
> > default-lifecycle:goal
> > or
> > default-lifecycle:phase
> >
> > Either of them should be pretty easy to implement, and pretty unlikely
> > to cause
> > any new problems. If we just use default by itself, then we don't
> > resolve
> > compile/testCompile or other similar situations.
> >
> > Brian E. Fox wrote:
> >> I think we've gone way off the rails here. I see there's a proposal
> > but
> >> haven't reviewed it yet.
> >>
> >> The first portion of this discussion was rather small in scope:
> >> Currently default executions of plugins have a null id. The null is
> > used
> >> to indicate the default config for a plugin across all executions AND
> > is
> >> used for lifecycle bound or plugins run on the cli. I think we simply
> >> should start by separating this. Keep default to replace the current
> >> null values for the global plugin configuration as it applies across
> > all
> >> executions. Then define an id for the lifecycle and cli invocations
> >> to
> >> be applied to tweak the values as needed (but keeping default to
> >> apply
> >> across all). Going beyond this into multifaceted ids for packages etc
> > is
> >> far too complicated imo.
> >>
> >> -----Original Message-----
> >> From: Paul Gier [mailto:pgier@redhat.com]
> >> Sent: Monday, November 10, 2008 3:44 PM
> >> To: Maven Developers List
> >> Subject: Re: Default plugin execution id
> >>
> >> Stephen Connolly wrote:
> >>> 2008/11/10 Paul Gier <pg...@redhat.com>
> >>>
> >>>> What about adding new syntax to the goal string? So that from the
> >> command
> >>>> line you could write something like this to refer to specific
> >> execution
> >>>> configs:
> >>>>
> >>>> mvn eclipse:eclipse{execution-1}
> >>>> or
> >>>> mvn eclipse:eclipse{execution-2}
> >>>>
> >>> How would that interact with the lifecycle?
> >>>
> >>> If I define execution-1 as attached to the compile phase, does that
> >> mean
> >>> that Maven will execute all phases upto compile and then just
> >>> execute
> >>> eclipse:eclipse, or is it just executing eclipse:eclipse and
> >>> ignoring
> >> any
> >>> plugins that are attached to prior phases? (With the side effect
> >>> that
> >> I'd
> >>> loose the information of the extra attached source directories)
> >>>
> >>> The more I think about it, calling out a specific execution *that
> >>> has
> >> been
> >>> attached to a specific phase* is a bad bad pattern, and it's a good
> >> thing
> >>> that Maven does not let you do that.
> >>>
> >>> If you need to do a pile of every-so-often tasks I'd define them in
> >> profiles
> >>> with each profile attaching the plugins to the requisite phases and
> >> defining
> >>> the defaultGoals to the highest phase necessary.
> >>>
> >>>
> >>>> The curly braces already seem to be associated with execution ids
> >>>> in
> >>>> maven's logging output. This would mean that components.xml file
> >>>> in
> >> maven
> >>>> core could be changed to provide execution IDs for each plugin that
> >> is
> >>>> executed, but probably no one wants to manually update this all the
> >> time.
> >>>> IMO the wildcard syntax is more than what is needed, and will make
> >> the pom
> >>>> a little less readable. The choice should be configure all
> >> executions or
> >>>> just one, otherwise it starts getting too complicated.
> >>>>
> >>>> After looking into the current behavior a little more, it is
> > possible
> >> to
> >>>> execute the same plugin goal twice in the same phase. So I think
> > all
> >> the
> >>>> naming schemes proposed except maybe Brett's
> >>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> >> future.
> >>>> But if we include a sequence number, then what happens if you add
> >> another
> >>>> execution of an existing plugin to the lifecycle? Do all the
> >> sequence
> >>>> numbers have to increment to make room?
> >>>>
> >>> Plus sequence number is non-deterministic. Also, you are
> >> forgetting... this
> >>> is not the id of executions *defined within the pom* but it's the id
> >> of
> >>> executions *defined by either the lifecycle or the plugin's mojo
> >> bindings*
> >>> I don't see how a mojo's descriptor can bind to any more than one
> >> phase, so
> >>> I guess the only thing preventing uniqueness is if the lifecycle can
> >> invoke
> >>> the same goal multiple times in the same phase... but hang on, how
> >>> is
> >> that a
> >>> problem if we say that the execution is per phase (unless you want
> >>> to
> >>> configure the different multiple executions differentially....
> >>> sounds
> >> like
> >>> you're writing a severe hack)
> >>>
> >>
> >> I just said that sequence numbers are the only way suggested that
> >> completely
> >> avoid id conflicts, but you're right it has other problems.
> >>
> >> I don't think it's a severe hack to have two executions for the same
> >> plugin goal
> >> in the same phase. For example, let's say I want to generate three
> > jar
> >> files
> >> with different manifests during the package phase. I need to call
> >> the
> >> assembly
> >> or jar plugin three times with different configurations. I'm just
> >> saying it's
> >> possible to have this scenario even in a default lifecycle, so there
> > is
> >> a small
> >> possibility of a name conflict even if we use something like
> >> lifecycle-<packaging>-<phase>-<plugin>-<goal>
> >>
> >>>> I think if we add the goal name to the execution like Benjamin
> >> suggested,
> >>>> we will be unlikely to run into conflicts. So I would prefer
> >> something
> >>>> like:
> >>>>
> >>>> default-lifecycle-compile
> >>>> default-lifecycle-testCompile
> >>>>
> >>> No, what if I bind compile goal to the compile phase and
> >> process-classes?
> >>> Now I have an execution that is bound to two phases (not allowed) or
> >> two
> >>> executions with the same id (not allowed)
> >>>
> >>> I'm sorry, but I don't see how you can exclude the phase from the
> >>> execution's id...
> >>>
> >>> And given that phases consist of names separated by -, it seems
> >> confusing to
> >>> name them with - as a separator.
> >>>
> >>
> >> Adding the phase to the ID doesn't prevent name conflicts, since you
> > can
> >> have
> >> the same goal twice in the same phase. I would guess it's actually
> >> be
> >> more
> >> common to have a goal twice in the same phase vs. in different
> >> phases.
> >> So I
> >> think the goal name is a better qualifier than the phase.
> >>
> >>> Now I don't mind if we do
> >>>
> >>> default-lifecycle:compile
> >>> default-lifecycle:test-compile
> >>>
> >>> or
> >>>
> >>> lifecycle:compile
> >>> lifecycle:test-compile
> >>>
> >>> or
> >>>
> >>> lifecycle:jar:compile
> >>> lifecycle:jar:test-compile
> >>>
> >>> or even use a different separator ('/' anyone?)
> >>>
> >>> The only advantage of specifying the packaging type is if you have a
> >> common
> >>> root pom. Wildcards only become really important if you use
> > packaging
> >> in
> >>> the id, but there is still the issue of what if I need to specify
> >> something
> >>> for all executions (but keep the defaults outside of an execution
> >> different
> >>> for when executing goals directly from the command line)
> >>>
> >>> I can live without wildcards.
> >>>
> >>> Sequence numbers are either non-deterministic, or will end up having
> > a
> >> 1:1
> >>> mapping with each phase, so why not just use the phase. Goal is
> >> non-unique,
> >>> and has the problem of multiple executions, and we can likely get
> > away
> >> with
> >>> just phase anyway.
> >>>
> >>>
> >>>> When building, this logs to the command line like this:
> >>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
> >>>>
> >>>>
> >>>>
> > ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Christian Schulte <cs...@schulte.it>
> Stephen Connolly wrote:
> > So, how did we get here: the use case that triggered all of this is
> > specifying a different configuration for the maven-compiler-plugin when
> > executed during the test-compile phase (to allow unit tests to be
> compiled
> > with Java 1.5, while the main code is compiled with 1.4)
>
> Until now, this information was missing to this thread. See the original
> mail starting this thread.
>
> "I'd like to be able to configure the default execution of a plugin
> within an execution instead of doing it through the main plugin
> configuration."
>
> > This is a valid use case (and a work around of adding testSource and
> > testTarget parameters has been implemented in the
> maven-compiler-plugin...
> > but it will arrise in other cases with other plugins)
>
> You are the only person who brought that up on this thread and I am glad
> you did. However, I still think the original author was talking about
> something else.
OK, you are correct... I got confused because the thread about configuring
different executions of the compiler plugin differently got noisy at or
around the same time as this thread got noisy, and I assumed that they were
related.... they are related but just not intentially ;-)
> > So the question being asked is: "What id do we assign to executions being
> > introduced via the packaging's lifecycle bindings?"
> >
> > The id cannot be "default" as we have multiple bindings of the same
> plugin
> > to different phases... which is why I came up with the proposal of:
> >
> > lifecycle:[packaging]:[phase]
> >
> > and allowing * to match all of either packaging or phase.
>
>
> It wasn't me proposing "default" at first! You have proven us all wrong
> about that id (default, default-execution-id,
> #groupId:artifactId:sequenceNumber, default-execution-compile,
> default-execution-testCompile). And you presented a solution which seems
> to be correct. I was already convinced by your first mail.
>
> > As to what about standalone: well they use the default configuration for
> the
> > plugin. If you think about it, executions are attached to the lifecycle
> for
> > a reason. if you just execute compiler:compile raw, you will not be able
> to
> > compile as the raw execution does not give the foo plugin a chance to
> attach
> > the additional source folders for the generated classes that it created.
>
> Maybe I was not clear about this standalone thing. This here
>
> mvn ide:eclipse
> mvn ide:netbeans
> mvn ide:eclipse ide:netbeans
>
> is also a valid use case. There is no way to configure different goals
> differently via the plugin's main configuration if these goals share the
> same parameters.
>
I agree that there is no way to configure these command line executions
directly... I just disagree that one should be able to configure them
separately ;-)
My first point is that unless plugins are invoked through an execution bound
to a lifecycle phase, you have no guarantee that the reactor has all the
relevant information to hand.
Take for example, the idea:idea or eclipse:eclipse goals (this is partly a
bad example but I'll explain why in a sec)
Ideally, this goal should be attached to the compile phase, so that all the
plugins that operator at the generate-sources, generate-resources, etc
phases of the lifecycle get a chance to attach the folders that they produce
to the list of source paths and resource paths.
If we allow you to execute that goal from the cli, you'll get an incorrect
environment because the plugins that generate source code have not been
executed.
When you think about it a bit more, what you are really asking for is the
ability to define custom lifecycle phases (which moves away from maven's
whole - there is a standard lifecycle - way of working... i.e. a bad thing)
My solution would be to define profiles for these executions that you want
to run from the command line... a profile can include a <build> section, and
so can define a <defaultGoal>, and once you can tweak the executions
inherited from the lifecycle, you can in essence turn off the long boring
bits that you are trying to skip...
you would in essence define that the defaultGoal for your fancyStuff profile
would be compile, you'd turn off execution of the foo-plugin as it does not
attach source but does a long download of validation rules, and turn off the
compiler plugin as you're just generating ide files, and you'd do
mvn -PfancyStuff
it would have the goals you need defined as executions attached to the
correct phases in the lifecycle... sorted in my view
In fact you should be able to do this right now:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>foo</artifactId>
<version>1-SNAPSHOT</version>
<packaging>pom</packaging>
<profiles>
<profile>
<id>fancyStuff</id>
<build>
<defaultGoal>validate</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-build-tools</id>
<phase>validate</phase>
<goals>
<goal>display-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Yep, you can... in fact this is a better way of doing all those command-line
tasks that are one-offs ;-)
>
> Well, I admit, this mixes up different things to look like the same but
> originally this thread was about having the ability to configure the
> default execution as an execution element in the pom and not to be
> forced to use the main configuration. This also means that it makes a
> configuration per goal(s) possible what is not possible using a plugin's
> main configuration!
>
> For example: Have these two goals define a mojo parameter
> "outputDirectory". If you would want to use different values per goal,
> one could not do that using the plugin's main configuration and is
> forced to introduce two different parameters like
> "eclipseOutputDirectory" and "netbeansOutputDirectory".
>
> As I understand things, it would become possible to have that single
> "outputDirectory" parameter be configured differently per goal. Which
> does not prove your solution wrong, does it ? That there is no
> standalone lifecycle does not mean that there could not be one with only
> a single phase all command line goals get added to automatically. Leads to:
>
> <id>cli:*</id>
> <goals>
> <goal>ide:eclipse</goal>
> </goals>
> <configuration>
> <outputDirectory>eclipse-value</outputDirectory>
> </configuration>
>
> <id>cli:*</id>
> <goals>
> <goal>ide:netbeans</goal>
> </goals>
> <configuration>
> <outputDirectory>netbeans-value</outputDirectory>
> </configuration>
>
> <id>cli:*</id>
> <goals>
> <goal>ide:eclipse</goal>
> <goal>ide:netbeans</goal>
> </goals>
> <configuration>
> <outputDirectory>same-value-for-both</outputDirectory>
> </configuration>
>
> And this would even work without such a standalone or cli lifecycle, I
> think. Did I really get that completely wrong ? Anyway, thanks _a lot_
> for your time and for explaining things in detail.
>
No need, see the pom snippet from above... which should be adaptable to do
anything you need!
>
> --
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Stephen Connolly wrote:
> Christian,
>
> Please do not take offense, but I think that you do not understand what is
> being discussed/proposed.
>
> Here is my understanding:
>
> Maven has the concept of a lifecycle. Each lifecycle consists of a sequence
> of phases. When you invoke Maven with a specific phase as the goal, Maven
> will process each phase in the lifecycle upto and including the phase
> specified as a goal.
>
> Each phase has attached plugin executions. There are two sources for
> attached plugin executions. The first source is from the packaging, while
> the second source is those executions defined in the pom.
>
> An execution must be attached to one and only one phase.
>
> When you define an execution in the pom, you do not have to specify an id
> for that execution: it gets the default value of "default". Thus if you
> want to tweak that execution using a profile, you just omit the id and the
> xml schema default of "default" is used again. If you want to bind a second
> execution to a different phase, at that point you need to define a second id
> for that second execution, as an execution is bound to one and only one
> phase. (Note that an execution bound to a phase may invoke multiple goals,
> and you can bind multiple executions to the same phase)
>
> The issue being discussed is that of executions defined via the lifecycle.
> At present these have an id of null. (A null value is impossible to define
> through the pom). That the value they have is not "default" is not a bug,
> it's a feature. We cannot give them the value "default" _because_ the
> lifecycle may define multiple executions of the plugin attached to different
> phases. For example, the jar packaging defines two executions of the
> maven-compiler-plugin: one attached to the compile phase and another
> attached to the test-compile phase. We cannot have two executions with the
> same id, so therefore your proposal to use "default" is dead in the water.
Agreed to that, although not explicitly stated in my mail, I admit. I
did not mean to prove you wrong. Absolutely not! It was more an "I
agree! Would this also work for standalone executions the way I asked ?"
> So, how did we get here: the use case that triggered all of this is
> specifying a different configuration for the maven-compiler-plugin when
> executed during the test-compile phase (to allow unit tests to be compiled
> with Java 1.5, while the main code is compiled with 1.4)
Until now, this information was missing to this thread. See the original
mail starting this thread.
"I'd like to be able to configure the default execution of a plugin
within an execution instead of doing it through the main plugin
configuration."
> This is a valid use case (and a work around of adding testSource and
> testTarget parameters has been implemented in the maven-compiler-plugin...
> but it will arrise in other cases with other plugins)
You are the only person who brought that up on this thread and I am glad
you did. However, I still think the original author was talking about
something else.
> So the question being asked is: "What id do we assign to executions being
> introduced via the packaging's lifecycle bindings?"
>
> The id cannot be "default" as we have multiple bindings of the same plugin
> to different phases... which is why I came up with the proposal of:
>
> lifecycle:[packaging]:[phase]
>
> and allowing * to match all of either packaging or phase.
It wasn't me proposing "default" at first! You have proven us all wrong
about that id (default, default-execution-id,
#groupId:artifactId:sequenceNumber, default-execution-compile,
default-execution-testCompile). And you presented a solution which seems
to be correct. I was already convinced by your first mail.
> As to what about standalone: well they use the default configuration for the
> plugin. If you think about it, executions are attached to the lifecycle for
> a reason. if you just execute compiler:compile raw, you will not be able to
> compile as the raw execution does not give the foo plugin a chance to attach
> the additional source folders for the generated classes that it created.
Maybe I was not clear about this standalone thing. This here
mvn ide:eclipse
mvn ide:netbeans
mvn ide:eclipse ide:netbeans
is also a valid use case. There is no way to configure different goals
differently via the plugin's main configuration if these goals share the
same parameters.
Well, I admit, this mixes up different things to look like the same but
originally this thread was about having the ability to configure the
default execution as an execution element in the pom and not to be
forced to use the main configuration. This also means that it makes a
configuration per goal(s) possible what is not possible using a plugin's
main configuration!
For example: Have these two goals define a mojo parameter
"outputDirectory". If you would want to use different values per goal,
one could not do that using the plugin's main configuration and is
forced to introduce two different parameters like
"eclipseOutputDirectory" and "netbeansOutputDirectory".
As I understand things, it would become possible to have that single
"outputDirectory" parameter be configured differently per goal. Which
does not prove your solution wrong, does it ? That there is no
standalone lifecycle does not mean that there could not be one with only
a single phase all command line goals get added to automatically. Leads to:
<id>cli:*</id>
<goals>
<goal>ide:eclipse</goal>
</goals>
<configuration>
<outputDirectory>eclipse-value</outputDirectory>
</configuration>
<id>cli:*</id>
<goals>
<goal>ide:netbeans</goal>
</goals>
<configuration>
<outputDirectory>netbeans-value</outputDirectory>
</configuration>
<id>cli:*</id>
<goals>
<goal>ide:eclipse</goal>
<goal>ide:netbeans</goal>
</goals>
<configuration>
<outputDirectory>same-value-for-both</outputDirectory>
</configuration>
And this would even work without such a standalone or cli lifecycle, I
think. Did I really get that completely wrong ? Anyway, thanks _a lot_
for your time and for explaining things in detail.
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Stephen Connolly <st...@gmail.com>
>
>
> 2008/11/10 Christian Schulte <cs...@schulte.it>
>
> Stephen Connolly wrote:
>> > AFAIK,
>> >
>> > The execution id refers only to a specific plugin, and each execution
>> can
>> > only match a specific phase... so I don't see the need to tie the
>> execution
>> > to a goal name, neither to the plugin name...
>> >
>> > What I see as bind important is if the plugin is bound to multiple
>> phases
>> > and you want to configure the different phases differently...
>> >
>> > At that point I think you're left with "breaking" the id as an id....
>> and
>> > you'd end up using a wild-card type matching, e.g.
>> >
>> > <id>lifecycle:jar:*</id>
>> >
>> > or
>> >
>> > <id>lifecycle:*:compile</id>
>> >
>> > or
>> >
>> > <id>lifecycle:*:*</id>
>> >
>> > All of which are useful, and do not require a schema change, and are
>> rather
>> > unlikely to interfere with existing builds... but it feels ugly to me...
>> and
>> > yet I'm proposing it! ;-)
>> >
>>
>> There must not necessarily be a lifecycle in use at all. How would this
>> execution id match standalone executions ? E.g.
>>
>> mvn eclipse:eclipse
>> mvn netbeans-freeform:generate-netbeans-project
>>
>> Consider a plugin with multiple such standalone goals for which a user
>> needs to provide configurations per goal. Neither the lifecycle nor the
>> packaging plays any role here, I think. E.g.
>>
>> mvn ide:eclipse
>> mvn ide:netbeans-freeform
>>
>> <id>none:*:none</id> ?
>>
>
> Christian,
>
> Please do not take offense, but I think that you do not understand what is
> being discussed/proposed.
>
> Here is my understanding:
>
> Maven has the concept of a lifecycle. Each lifecycle consists of a sequence
> of phases. When you invoke Maven with a specific phase as the goal, Maven
> will process each phase in the lifecycle upto and including the phase
> specified as a goal.
>
> Each phase has attached plugin executions. There are two sources for
> attached plugin executions. The first source is from the packaging, while
> the second source is those executions defined in the pom.
>
> An execution must be attached to one and only one phase.
>
> When you define an execution in the pom, you do not have to specify an id
> for that execution: it gets the default value of "default". Thus if you
> want to tweak that execution using a profile, you just omit the id and the
> xml schema default of "default" is used again. If you want to bind a second
> execution to a different phase, at that point you need to define a second id
> for that second execution, as an execution is bound to one and only one
> phase. (Note that an execution bound to a phase may invoke multiple goals,
> and you can bind multiple executions to the same phase)
>
> The issue being discussed is that of executions defined via the lifecycle.
> At present these have an id of null. (A null value is impossible to define
> through the pom). That the value they have is not "default" is not a bug,
> it's a feature. We cannot give them the value "default" _because_ the
> lifecycle may define multiple executions of the plugin attached to different
> phases. For example, the jar packaging defines two executions of the
> maven-compiler-plugin: one attached to the compile phase and another
> attached to the test-compile phase. We cannot have two executions with the
> same id, so therefore your proposal to use "default" is dead in the water.
>
> So, how did we get here: the use case that triggered all of this is
> specifying a different configuration for the maven-compiler-plugin when
> executed during the test-compile phase (to allow unit tests to be compiled
> with Java 1.5, while the main code is compiled with 1.4)
>
> This is a valid use case (and a work around of adding testSource and
> testTarget parameters has been implemented in the maven-compiler-plugin...
> but it will arrise in other cases with other plugins)
>
> So the question being asked is: "What id do we assign to executions being
> introduced via the packaging's lifecycle bindings?"
>
> The id cannot be "default" as we have multiple bindings of the same plugin
> to different phases... which is why I came up with the proposal of:
>
> lifecycle:[packaging]:[phase]
>
> and allowing * to match all of either packaging or phase.
>
>
> As to what about standalone: well they use the default configuration for
> the plugin. If you think about it, executions are attached to the lifecycle
> for a reason. if you just execute compiler:compile raw, you will not be
> able to compile as the raw execution does not give the foo plugin a chance
> to attach the additional source folders for the generated classes that it
> created.
>
> -Stephen
>
Thinking about this further, I realize that there is an additional use case:
executions introduced by the plugin itself:
When I define a plugin, I can bind each mojo's to a phase. For example I
might bind the foo-maven-plugin's barMojo to the generate-sources phase and
the testBarMojo to the generate-test-sources phase.
At present, these executions all use just the default configuration, and do
not have an id (I suspect they have a null id). Perhaps we should also
generate an id for these executions as well.... so we'd have
I'm less convinced of the need for tagging against the packaging... but as
it could be a valid use case, I'll leave it in...
so I'm suggesting, for executions introduced via the packaging:
<id>lifecycle:[packaging]:[phase]</id>
e.g.
<id>lifecycle:jar:compile</id>
or
<id>lifecycle:*:compile</id>
or
<id>lifecycle:jar:*</id>
or
<id>lifecycle:*:*</id>
and for executions introduced via the plugin's annotations and the fact that
the pom adds the plugin
<id>build:plugin:[phase]</id>
e.g.
<id>build:plugin:compile</id>
or
<id>build:plugin:*</id>
note I'm using "plugin" verbatim as the execution id's only have to be
unique for each plugin.
(We could also introduce <id>report:plugin:[phase]</id> to help with the
reporting config, e.g. <id>report:plugin:site</id> and
<id>report:plugin:site-deploy</id> but I'm less sure of that)
-Stephen
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Christian Schulte <cs...@schulte.it>
> Stephen Connolly wrote:
> > AFAIK,
> >
> > The execution id refers only to a specific plugin, and each execution can
> > only match a specific phase... so I don't see the need to tie the
> execution
> > to a goal name, neither to the plugin name...
> >
> > What I see as bind important is if the plugin is bound to multiple phases
> > and you want to configure the different phases differently...
> >
> > At that point I think you're left with "breaking" the id as an id.... and
> > you'd end up using a wild-card type matching, e.g.
> >
> > <id>lifecycle:jar:*</id>
> >
> > or
> >
> > <id>lifecycle:*:compile</id>
> >
> > or
> >
> > <id>lifecycle:*:*</id>
> >
> > All of which are useful, and do not require a schema change, and are
> rather
> > unlikely to interfere with existing builds... but it feels ugly to me...
> and
> > yet I'm proposing it! ;-)
> >
>
> There must not necessarily be a lifecycle in use at all. How would this
> execution id match standalone executions ? E.g.
>
> mvn eclipse:eclipse
> mvn netbeans-freeform:generate-netbeans-project
>
> Consider a plugin with multiple such standalone goals for which a user
> needs to provide configurations per goal. Neither the lifecycle nor the
> packaging plays any role here, I think. E.g.
>
> mvn ide:eclipse
> mvn ide:netbeans-freeform
>
> <id>none:*:none</id> ?
>
Christian,
Please do not take offense, but I think that you do not understand what is
being discussed/proposed.
Here is my understanding:
Maven has the concept of a lifecycle. Each lifecycle consists of a sequence
of phases. When you invoke Maven with a specific phase as the goal, Maven
will process each phase in the lifecycle upto and including the phase
specified as a goal.
Each phase has attached plugin executions. There are two sources for
attached plugin executions. The first source is from the packaging, while
the second source is those executions defined in the pom.
An execution must be attached to one and only one phase.
When you define an execution in the pom, you do not have to specify an id
for that execution: it gets the default value of "default". Thus if you
want to tweak that execution using a profile, you just omit the id and the
xml schema default of "default" is used again. If you want to bind a second
execution to a different phase, at that point you need to define a second id
for that second execution, as an execution is bound to one and only one
phase. (Note that an execution bound to a phase may invoke multiple goals,
and you can bind multiple executions to the same phase)
The issue being discussed is that of executions defined via the lifecycle.
At present these have an id of null. (A null value is impossible to define
through the pom). That the value they have is not "default" is not a bug,
it's a feature. We cannot give them the value "default" _because_ the
lifecycle may define multiple executions of the plugin attached to different
phases. For example, the jar packaging defines two executions of the
maven-compiler-plugin: one attached to the compile phase and another
attached to the test-compile phase. We cannot have two executions with the
same id, so therefore your proposal to use "default" is dead in the water.
So, how did we get here: the use case that triggered all of this is
specifying a different configuration for the maven-compiler-plugin when
executed during the test-compile phase (to allow unit tests to be compiled
with Java 1.5, while the main code is compiled with 1.4)
This is a valid use case (and a work around of adding testSource and
testTarget parameters has been implemented in the maven-compiler-plugin...
but it will arrise in other cases with other plugins)
So the question being asked is: "What id do we assign to executions being
introduced via the packaging's lifecycle bindings?"
The id cannot be "default" as we have multiple bindings of the same plugin
to different phases... which is why I came up with the proposal of:
lifecycle:[packaging]:[phase]
and allowing * to match all of either packaging or phase.
As to what about standalone: well they use the default configuration for the
plugin. If you think about it, executions are attached to the lifecycle for
a reason. if you just execute compiler:compile raw, you will not be able to
compile as the raw execution does not give the foo plugin a chance to attach
the additional source folders for the generated classes that it created.
-Stephen
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
Stephen Connolly wrote:
> 2008/11/10 Paul Gier <pg...@redhat.com>
>
>> What about adding new syntax to the goal string? So that from the command
>> line you could write something like this to refer to specific execution
>> configs:
>>
>> mvn eclipse:eclipse{execution-1}
>> or
>> mvn eclipse:eclipse{execution-2}
>>
>
> How would that interact with the lifecycle?
>
> If I define execution-1 as attached to the compile phase, does that mean
> that Maven will execute all phases upto compile and then just execute
> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring any
> plugins that are attached to prior phases? (With the side effect that I'd
> loose the information of the extra attached source directories)
>
> The more I think about it, calling out a specific execution *that has been
> attached to a specific phase* is a bad bad pattern, and it's a good thing
> that Maven does not let you do that.
>
> If you need to do a pile of every-so-often tasks I'd define them in profiles
> with each profile attaching the plugins to the requisite phases and defining
> the defaultGoals to the highest phase necessary.
>
>
I was imagining that the interaction with the phases wouldn't change from how it
is now. For example:
mvn eclipse:eclipse{execution-1}
This would behave the same way it does now (calls the genereate-resources phase
then the eclipse goal) except that it would look for relevant configuration in
execution-1. And of course merge that with the global plugin config.
But it would ignore the phase and goals settings of the execution.
>> The curly braces already seem to be associated with execution ids in
>> maven's logging output. This would mean that components.xml file in maven
>> core could be changed to provide execution IDs for each plugin that is
>> executed, but probably no one wants to manually update this all the time.
>>
>> IMO the wildcard syntax is more than what is needed, and will make the pom
>> a little less readable. The choice should be configure all executions or
>> just one, otherwise it starts getting too complicated.
>>
>> After looking into the current behavior a little more, it is possible to
>> execute the same plugin goal twice in the same phase. So I think all the
>> naming schemes proposed except maybe Brett's
>> (groupId:artifactId:sequenceNumber) could run into conflicts in the future.
>> But if we include a sequence number, then what happens if you add another
>> execution of an existing plugin to the lifecycle? Do all the sequence
>> numbers have to increment to make room?
>>
>
> Plus sequence number is non-deterministic. Also, you are forgetting... this
> is not the id of executions *defined within the pom* but it's the id of
> executions *defined by either the lifecycle or the plugin's mojo bindings*
>
> I don't see how a mojo's descriptor can bind to any more than one phase, so
> I guess the only thing preventing uniqueness is if the lifecycle can invoke
> the same goal multiple times in the same phase... but hang on, how is that a
> problem if we say that the execution is per phase (unless you want to
> configure the different multiple executions differentially.... sounds like
> you're writing a severe hack)
>
>
>> I think if we add the goal name to the execution like Benjamin suggested,
>> we will be unlikely to run into conflicts. So I would prefer something
>> like:
>>
>> default-lifecycle-compile
>> default-lifecycle-testCompile
>>
>
> No, what if I bind compile goal to the compile phase and process-classes?
>
> Now I have an execution that is bound to two phases (not allowed) or two
> executions with the same id (not allowed)
>
> I'm sorry, but I don't see how you can exclude the phase from the
> execution's id...
>
> And given that phases consist of names separated by -, it seems confusing to
> name them with - as a separator.
>
> Now I don't mind if we do
>
> default-lifecycle:compile
> default-lifecycle:test-compile
>
> or
>
> lifecycle:compile
> lifecycle:test-compile
>
> or
>
> lifecycle:jar:compile
> lifecycle:jar:test-compile
>
> or even use a different separator ('/' anyone?)
>
> The only advantage of specifying the packaging type is if you have a common
> root pom. Wildcards only become really important if you use packaging in
> the id, but there is still the issue of what if I need to specify something
> for all executions (but keep the defaults outside of an execution different
> for when executing goals directly from the command line)
>
> I can live without wildcards.
>
> Sequence numbers are either non-deterministic, or will end up having a 1:1
> mapping with each phase, so why not just use the phase. Goal is non-unique,
> and has the problem of multiple executions, and we can likely get away with
> just phase anyway.
>
>
>> When building, this logs to the command line like this:
>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Brian E. Fox wrote:
> I think we've gone way off the rails here. I see there's a proposal but
> haven't reviewed it yet.
>
> The first portion of this discussion was rather small in scope:
> Currently default executions of plugins have a null id. The null is used
> to indicate the default config for a plugin across all executions AND is
> used for lifecycle bound or plugins run on the cli. I think we simply
> should start by separating this. Keep default to replace the current
> null values for the global plugin configuration as it applies across all
> executions. Then define an id for the lifecycle and cli invocations to
> be applied to tweak the values as needed (but keeping default to apply
> across all). Going beyond this into multifaceted ids for packages etc is
> far too complicated imo.
Leads to
<executions>
<execution>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</execution>
</executions>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
Right ?
Completely hides the lifecycle from the user and removes the need of
redundant mojo parameters. Minimal input required from the user - Maven
just does the right thing. At least for this concrete example.
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Again, why? It's not possible now so it's obviously working for most
cases today.
-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
Sent: Monday, November 10, 2008 4:27 PM
To: Maven Developers List
Cc: Maven Developers List
Subject: Re: Default plugin execution id
well you need to separate out the executions by phase in case somebody
decided to change the phase specified in the execution
Sent from my iPod
On 10 Nov 2008, at 21:29, "Brian E. Fox" <br...@reply.infinity.nu>
wrote:
> I don't see how phase is really needed. It applies to only two plugins
> that I can think of, compiler and resources, and this is a bigger
> problem for a 3.x timeframe. I think that something simple can cover
> 90%
> of the cases and be doable in 2.x
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 4:05 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Yes, you're right, I think this is getting more complicated that it
> needs to be.
> Either of these is fine with me:
> default-lifecycle:goal
> or
> default-lifecycle:phase
>
> Either of them should be pretty easy to implement, and pretty unlikely
> to cause
> any new problems. If we just use default by itself, then we don't
> resolve
> compile/testCompile or other similar situations.
>
> Brian E. Fox wrote:
>> I think we've gone way off the rails here. I see there's a proposal
> but
>> haven't reviewed it yet.
>>
>> The first portion of this discussion was rather small in scope:
>> Currently default executions of plugins have a null id. The null is
> used
>> to indicate the default config for a plugin across all executions AND
> is
>> used for lifecycle bound or plugins run on the cli. I think we simply
>> should start by separating this. Keep default to replace the current
>> null values for the global plugin configuration as it applies across
> all
>> executions. Then define an id for the lifecycle and cli invocations
>> to
>> be applied to tweak the values as needed (but keeping default to
>> apply
>> across all). Going beyond this into multifaceted ids for packages etc
> is
>> far too complicated imo.
>>
>> -----Original Message-----
>> From: Paul Gier [mailto:pgier@redhat.com]
>> Sent: Monday, November 10, 2008 3:44 PM
>> To: Maven Developers List
>> Subject: Re: Default plugin execution id
>>
>> Stephen Connolly wrote:
>>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>>
>>>> What about adding new syntax to the goal string? So that from the
>> command
>>>> line you could write something like this to refer to specific
>> execution
>>>> configs:
>>>>
>>>> mvn eclipse:eclipse{execution-1}
>>>> or
>>>> mvn eclipse:eclipse{execution-2}
>>>>
>>> How would that interact with the lifecycle?
>>>
>>> If I define execution-1 as attached to the compile phase, does that
>> mean
>>> that Maven will execute all phases upto compile and then just
>>> execute
>>> eclipse:eclipse, or is it just executing eclipse:eclipse and
>>> ignoring
>> any
>>> plugins that are attached to prior phases? (With the side effect
>>> that
>> I'd
>>> loose the information of the extra attached source directories)
>>>
>>> The more I think about it, calling out a specific execution *that
>>> has
>> been
>>> attached to a specific phase* is a bad bad pattern, and it's a good
>> thing
>>> that Maven does not let you do that.
>>>
>>> If you need to do a pile of every-so-often tasks I'd define them in
>> profiles
>>> with each profile attaching the plugins to the requisite phases and
>> defining
>>> the defaultGoals to the highest phase necessary.
>>>
>>>
>>>> The curly braces already seem to be associated with execution ids
>>>> in
>>>> maven's logging output. This would mean that components.xml file
>>>> in
>> maven
>>>> core could be changed to provide execution IDs for each plugin that
>> is
>>>> executed, but probably no one wants to manually update this all the
>> time.
>>>> IMO the wildcard syntax is more than what is needed, and will make
>> the pom
>>>> a little less readable. The choice should be configure all
>> executions or
>>>> just one, otherwise it starts getting too complicated.
>>>>
>>>> After looking into the current behavior a little more, it is
> possible
>> to
>>>> execute the same plugin goal twice in the same phase. So I think
> all
>> the
>>>> naming schemes proposed except maybe Brett's
>>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
>> future.
>>>> But if we include a sequence number, then what happens if you add
>> another
>>>> execution of an existing plugin to the lifecycle? Do all the
>> sequence
>>>> numbers have to increment to make room?
>>>>
>>> Plus sequence number is non-deterministic. Also, you are
>> forgetting... this
>>> is not the id of executions *defined within the pom* but it's the id
>> of
>>> executions *defined by either the lifecycle or the plugin's mojo
>> bindings*
>>> I don't see how a mojo's descriptor can bind to any more than one
>> phase, so
>>> I guess the only thing preventing uniqueness is if the lifecycle can
>> invoke
>>> the same goal multiple times in the same phase... but hang on, how
>>> is
>> that a
>>> problem if we say that the execution is per phase (unless you want
>>> to
>>> configure the different multiple executions differentially....
>>> sounds
>> like
>>> you're writing a severe hack)
>>>
>>
>> I just said that sequence numbers are the only way suggested that
>> completely
>> avoid id conflicts, but you're right it has other problems.
>>
>> I don't think it's a severe hack to have two executions for the same
>> plugin goal
>> in the same phase. For example, let's say I want to generate three
> jar
>> files
>> with different manifests during the package phase. I need to call
>> the
>> assembly
>> or jar plugin three times with different configurations. I'm just
>> saying it's
>> possible to have this scenario even in a default lifecycle, so there
> is
>> a small
>> possibility of a name conflict even if we use something like
>> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>>
>>>> I think if we add the goal name to the execution like Benjamin
>> suggested,
>>>> we will be unlikely to run into conflicts. So I would prefer
>> something
>>>> like:
>>>>
>>>> default-lifecycle-compile
>>>> default-lifecycle-testCompile
>>>>
>>> No, what if I bind compile goal to the compile phase and
>> process-classes?
>>> Now I have an execution that is bound to two phases (not allowed) or
>> two
>>> executions with the same id (not allowed)
>>>
>>> I'm sorry, but I don't see how you can exclude the phase from the
>>> execution's id...
>>>
>>> And given that phases consist of names separated by -, it seems
>> confusing to
>>> name them with - as a separator.
>>>
>>
>> Adding the phase to the ID doesn't prevent name conflicts, since you
> can
>> have
>> the same goal twice in the same phase. I would guess it's actually
>> be
>> more
>> common to have a goal twice in the same phase vs. in different
>> phases.
>> So I
>> think the goal name is a better qualifier than the phase.
>>
>>> Now I don't mind if we do
>>>
>>> default-lifecycle:compile
>>> default-lifecycle:test-compile
>>>
>>> or
>>>
>>> lifecycle:compile
>>> lifecycle:test-compile
>>>
>>> or
>>>
>>> lifecycle:jar:compile
>>> lifecycle:jar:test-compile
>>>
>>> or even use a different separator ('/' anyone?)
>>>
>>> The only advantage of specifying the packaging type is if you have a
>> common
>>> root pom. Wildcards only become really important if you use
> packaging
>> in
>>> the id, but there is still the issue of what if I need to specify
>> something
>>> for all executions (but keep the defaults outside of an execution
>> different
>>> for when executing goals directly from the command line)
>>>
>>> I can live without wildcards.
>>>
>>> Sequence numbers are either non-deterministic, or will end up having
> a
>> 1:1
>>> mapping with each phase, so why not just use the phase. Goal is
>> non-unique,
>>> and has the problem of multiple executions, and we can likely get
> away
>> with
>>> just phase anyway.
>>>
>>>
>>>> When building, this logs to the command line like this:
>>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
well you need to separate out the executions by phase in case somebody
decided to change the phase specified in the execution
Sent from my iPod
On 10 Nov 2008, at 21:29, "Brian E. Fox" <br...@reply.infinity.nu>
wrote:
> I don't see how phase is really needed. It applies to only two plugins
> that I can think of, compiler and resources, and this is a bigger
> problem for a 3.x timeframe. I think that something simple can cover
> 90%
> of the cases and be doable in 2.x
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 4:05 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Yes, you're right, I think this is getting more complicated that it
> needs to be.
> Either of these is fine with me:
> default-lifecycle:goal
> or
> default-lifecycle:phase
>
> Either of them should be pretty easy to implement, and pretty unlikely
> to cause
> any new problems. If we just use default by itself, then we don't
> resolve
> compile/testCompile or other similar situations.
>
> Brian E. Fox wrote:
>> I think we've gone way off the rails here. I see there's a proposal
> but
>> haven't reviewed it yet.
>>
>> The first portion of this discussion was rather small in scope:
>> Currently default executions of plugins have a null id. The null is
> used
>> to indicate the default config for a plugin across all executions AND
> is
>> used for lifecycle bound or plugins run on the cli. I think we simply
>> should start by separating this. Keep default to replace the current
>> null values for the global plugin configuration as it applies across
> all
>> executions. Then define an id for the lifecycle and cli invocations
>> to
>> be applied to tweak the values as needed (but keeping default to
>> apply
>> across all). Going beyond this into multifaceted ids for packages etc
> is
>> far too complicated imo.
>>
>> -----Original Message-----
>> From: Paul Gier [mailto:pgier@redhat.com]
>> Sent: Monday, November 10, 2008 3:44 PM
>> To: Maven Developers List
>> Subject: Re: Default plugin execution id
>>
>> Stephen Connolly wrote:
>>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>>
>>>> What about adding new syntax to the goal string? So that from the
>> command
>>>> line you could write something like this to refer to specific
>> execution
>>>> configs:
>>>>
>>>> mvn eclipse:eclipse{execution-1}
>>>> or
>>>> mvn eclipse:eclipse{execution-2}
>>>>
>>> How would that interact with the lifecycle?
>>>
>>> If I define execution-1 as attached to the compile phase, does that
>> mean
>>> that Maven will execute all phases upto compile and then just
>>> execute
>>> eclipse:eclipse, or is it just executing eclipse:eclipse and
>>> ignoring
>> any
>>> plugins that are attached to prior phases? (With the side effect
>>> that
>> I'd
>>> loose the information of the extra attached source directories)
>>>
>>> The more I think about it, calling out a specific execution *that
>>> has
>> been
>>> attached to a specific phase* is a bad bad pattern, and it's a good
>> thing
>>> that Maven does not let you do that.
>>>
>>> If you need to do a pile of every-so-often tasks I'd define them in
>> profiles
>>> with each profile attaching the plugins to the requisite phases and
>> defining
>>> the defaultGoals to the highest phase necessary.
>>>
>>>
>>>> The curly braces already seem to be associated with execution ids
>>>> in
>>>> maven's logging output. This would mean that components.xml file
>>>> in
>> maven
>>>> core could be changed to provide execution IDs for each plugin that
>> is
>>>> executed, but probably no one wants to manually update this all the
>> time.
>>>> IMO the wildcard syntax is more than what is needed, and will make
>> the pom
>>>> a little less readable. The choice should be configure all
>> executions or
>>>> just one, otherwise it starts getting too complicated.
>>>>
>>>> After looking into the current behavior a little more, it is
> possible
>> to
>>>> execute the same plugin goal twice in the same phase. So I think
> all
>> the
>>>> naming schemes proposed except maybe Brett's
>>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
>> future.
>>>> But if we include a sequence number, then what happens if you add
>> another
>>>> execution of an existing plugin to the lifecycle? Do all the
>> sequence
>>>> numbers have to increment to make room?
>>>>
>>> Plus sequence number is non-deterministic. Also, you are
>> forgetting... this
>>> is not the id of executions *defined within the pom* but it's the id
>> of
>>> executions *defined by either the lifecycle or the plugin's mojo
>> bindings*
>>> I don't see how a mojo's descriptor can bind to any more than one
>> phase, so
>>> I guess the only thing preventing uniqueness is if the lifecycle can
>> invoke
>>> the same goal multiple times in the same phase... but hang on, how
>>> is
>> that a
>>> problem if we say that the execution is per phase (unless you want
>>> to
>>> configure the different multiple executions differentially....
>>> sounds
>> like
>>> you're writing a severe hack)
>>>
>>
>> I just said that sequence numbers are the only way suggested that
>> completely
>> avoid id conflicts, but you're right it has other problems.
>>
>> I don't think it's a severe hack to have two executions for the same
>> plugin goal
>> in the same phase. For example, let's say I want to generate three
> jar
>> files
>> with different manifests during the package phase. I need to call
>> the
>> assembly
>> or jar plugin three times with different configurations. I'm just
>> saying it's
>> possible to have this scenario even in a default lifecycle, so there
> is
>> a small
>> possibility of a name conflict even if we use something like
>> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>>
>>>> I think if we add the goal name to the execution like Benjamin
>> suggested,
>>>> we will be unlikely to run into conflicts. So I would prefer
>> something
>>>> like:
>>>>
>>>> default-lifecycle-compile
>>>> default-lifecycle-testCompile
>>>>
>>> No, what if I bind compile goal to the compile phase and
>> process-classes?
>>> Now I have an execution that is bound to two phases (not allowed) or
>> two
>>> executions with the same id (not allowed)
>>>
>>> I'm sorry, but I don't see how you can exclude the phase from the
>>> execution's id...
>>>
>>> And given that phases consist of names separated by -, it seems
>> confusing to
>>> name them with - as a separator.
>>>
>>
>> Adding the phase to the ID doesn't prevent name conflicts, since you
> can
>> have
>> the same goal twice in the same phase. I would guess it's actually
>> be
>> more
>> common to have a goal twice in the same phase vs. in different
>> phases.
>> So I
>> think the goal name is a better qualifier than the phase.
>>
>>> Now I don't mind if we do
>>>
>>> default-lifecycle:compile
>>> default-lifecycle:test-compile
>>>
>>> or
>>>
>>> lifecycle:compile
>>> lifecycle:test-compile
>>>
>>> or
>>>
>>> lifecycle:jar:compile
>>> lifecycle:jar:test-compile
>>>
>>> or even use a different separator ('/' anyone?)
>>>
>>> The only advantage of specifying the packaging type is if you have a
>> common
>>> root pom. Wildcards only become really important if you use
> packaging
>> in
>>> the id, but there is still the issue of what if I need to specify
>> something
>>> for all executions (but keep the defaults outside of an execution
>> different
>>> for when executing goals directly from the command line)
>>>
>>> I can live without wildcards.
>>>
>>> Sequence numbers are either non-deterministic, or will end up having
> a
>> 1:1
>>> mapping with each phase, so why not just use the phase. Goal is
>> non-unique,
>>> and has the problem of multiple executions, and we can likely get
> away
>> with
>>> just phase anyway.
>>>
>>>
>>>> When building, this logs to the command line like this:
>>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
I don't see how phase is really needed. It applies to only two plugins
that I can think of, compiler and resources, and this is a bigger
problem for a 3.x timeframe. I think that something simple can cover 90%
of the cases and be doable in 2.x
-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com]
Sent: Monday, November 10, 2008 4:05 PM
To: Maven Developers List
Subject: Re: Default plugin execution id
Yes, you're right, I think this is getting more complicated that it
needs to be.
Either of these is fine with me:
default-lifecycle:goal
or
default-lifecycle:phase
Either of them should be pretty easy to implement, and pretty unlikely
to cause
any new problems. If we just use default by itself, then we don't
resolve
compile/testCompile or other similar situations.
Brian E. Fox wrote:
> I think we've gone way off the rails here. I see there's a proposal
but
> haven't reviewed it yet.
>
> The first portion of this discussion was rather small in scope:
> Currently default executions of plugins have a null id. The null is
used
> to indicate the default config for a plugin across all executions AND
is
> used for lifecycle bound or plugins run on the cli. I think we simply
> should start by separating this. Keep default to replace the current
> null values for the global plugin configuration as it applies across
all
> executions. Then define an id for the lifecycle and cli invocations to
> be applied to tweak the values as needed (but keeping default to apply
> across all). Going beyond this into multifaceted ids for packages etc
is
> far too complicated imo.
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 3:44 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Stephen Connolly wrote:
>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>
>>> What about adding new syntax to the goal string? So that from the
> command
>>> line you could write something like this to refer to specific
> execution
>>> configs:
>>>
>>> mvn eclipse:eclipse{execution-1}
>>> or
>>> mvn eclipse:eclipse{execution-2}
>>>
>> How would that interact with the lifecycle?
>>
>> If I define execution-1 as attached to the compile phase, does that
> mean
>> that Maven will execute all phases upto compile and then just execute
>> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring
> any
>> plugins that are attached to prior phases? (With the side effect that
> I'd
>> loose the information of the extra attached source directories)
>>
>> The more I think about it, calling out a specific execution *that has
> been
>> attached to a specific phase* is a bad bad pattern, and it's a good
> thing
>> that Maven does not let you do that.
>>
>> If you need to do a pile of every-so-often tasks I'd define them in
> profiles
>> with each profile attaching the plugins to the requisite phases and
> defining
>> the defaultGoals to the highest phase necessary.
>>
>>
>>> The curly braces already seem to be associated with execution ids in
>>> maven's logging output. This would mean that components.xml file in
> maven
>>> core could be changed to provide execution IDs for each plugin that
> is
>>> executed, but probably no one wants to manually update this all the
> time.
>>> IMO the wildcard syntax is more than what is needed, and will make
> the pom
>>> a little less readable. The choice should be configure all
> executions or
>>> just one, otherwise it starts getting too complicated.
>>>
>>> After looking into the current behavior a little more, it is
possible
> to
>>> execute the same plugin goal twice in the same phase. So I think
all
> the
>>> naming schemes proposed except maybe Brett's
>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> future.
>>> But if we include a sequence number, then what happens if you add
> another
>>> execution of an existing plugin to the lifecycle? Do all the
> sequence
>>> numbers have to increment to make room?
>>>
>> Plus sequence number is non-deterministic. Also, you are
> forgetting... this
>> is not the id of executions *defined within the pom* but it's the id
> of
>> executions *defined by either the lifecycle or the plugin's mojo
> bindings*
>> I don't see how a mojo's descriptor can bind to any more than one
> phase, so
>> I guess the only thing preventing uniqueness is if the lifecycle can
> invoke
>> the same goal multiple times in the same phase... but hang on, how is
> that a
>> problem if we say that the execution is per phase (unless you want to
>> configure the different multiple executions differentially.... sounds
> like
>> you're writing a severe hack)
>>
>
> I just said that sequence numbers are the only way suggested that
> completely
> avoid id conflicts, but you're right it has other problems.
>
> I don't think it's a severe hack to have two executions for the same
> plugin goal
> in the same phase. For example, let's say I want to generate three
jar
> files
> with different manifests during the package phase. I need to call the
> assembly
> or jar plugin three times with different configurations. I'm just
> saying it's
> possible to have this scenario even in a default lifecycle, so there
is
> a small
> possibility of a name conflict even if we use something like
> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
>>> I think if we add the goal name to the execution like Benjamin
> suggested,
>>> we will be unlikely to run into conflicts. So I would prefer
> something
>>> like:
>>>
>>> default-lifecycle-compile
>>> default-lifecycle-testCompile
>>>
>> No, what if I bind compile goal to the compile phase and
> process-classes?
>> Now I have an execution that is bound to two phases (not allowed) or
> two
>> executions with the same id (not allowed)
>>
>> I'm sorry, but I don't see how you can exclude the phase from the
>> execution's id...
>>
>> And given that phases consist of names separated by -, it seems
> confusing to
>> name them with - as a separator.
>>
>
> Adding the phase to the ID doesn't prevent name conflicts, since you
can
> have
> the same goal twice in the same phase. I would guess it's actually be
> more
> common to have a goal twice in the same phase vs. in different phases.
> So I
> think the goal name is a better qualifier than the phase.
>
>> Now I don't mind if we do
>>
>> default-lifecycle:compile
>> default-lifecycle:test-compile
>>
>> or
>>
>> lifecycle:compile
>> lifecycle:test-compile
>>
>> or
>>
>> lifecycle:jar:compile
>> lifecycle:jar:test-compile
>>
>> or even use a different separator ('/' anyone?)
>>
>> The only advantage of specifying the packaging type is if you have a
> common
>> root pom. Wildcards only become really important if you use
packaging
> in
>> the id, but there is still the issue of what if I need to specify
> something
>> for all executions (but keep the defaults outside of an execution
> different
>> for when executing goals directly from the command line)
>>
>> I can live without wildcards.
>>
>> Sequence numbers are either non-deterministic, or will end up having
a
> 1:1
>> mapping with each phase, so why not just use the phase. Goal is
> non-unique,
>> and has the problem of multiple executions, and we can likely get
away
> with
>> just phase anyway.
>>
>>
>>> When building, this logs to the command line like this:
>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
Yes, you're right, I think this is getting more complicated that it needs to be.
Either of these is fine with me:
default-lifecycle:goal
or
default-lifecycle:phase
Either of them should be pretty easy to implement, and pretty unlikely to cause
any new problems. If we just use default by itself, then we don't resolve
compile/testCompile or other similar situations.
Brian E. Fox wrote:
> I think we've gone way off the rails here. I see there's a proposal but
> haven't reviewed it yet.
>
> The first portion of this discussion was rather small in scope:
> Currently default executions of plugins have a null id. The null is used
> to indicate the default config for a plugin across all executions AND is
> used for lifecycle bound or plugins run on the cli. I think we simply
> should start by separating this. Keep default to replace the current
> null values for the global plugin configuration as it applies across all
> executions. Then define an id for the lifecycle and cli invocations to
> be applied to tweak the values as needed (but keeping default to apply
> across all). Going beyond this into multifaceted ids for packages etc is
> far too complicated imo.
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Monday, November 10, 2008 3:44 PM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Stephen Connolly wrote:
>> 2008/11/10 Paul Gier <pg...@redhat.com>
>>
>>> What about adding new syntax to the goal string? So that from the
> command
>>> line you could write something like this to refer to specific
> execution
>>> configs:
>>>
>>> mvn eclipse:eclipse{execution-1}
>>> or
>>> mvn eclipse:eclipse{execution-2}
>>>
>> How would that interact with the lifecycle?
>>
>> If I define execution-1 as attached to the compile phase, does that
> mean
>> that Maven will execute all phases upto compile and then just execute
>> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring
> any
>> plugins that are attached to prior phases? (With the side effect that
> I'd
>> loose the information of the extra attached source directories)
>>
>> The more I think about it, calling out a specific execution *that has
> been
>> attached to a specific phase* is a bad bad pattern, and it's a good
> thing
>> that Maven does not let you do that.
>>
>> If you need to do a pile of every-so-often tasks I'd define them in
> profiles
>> with each profile attaching the plugins to the requisite phases and
> defining
>> the defaultGoals to the highest phase necessary.
>>
>>
>>> The curly braces already seem to be associated with execution ids in
>>> maven's logging output. This would mean that components.xml file in
> maven
>>> core could be changed to provide execution IDs for each plugin that
> is
>>> executed, but probably no one wants to manually update this all the
> time.
>>> IMO the wildcard syntax is more than what is needed, and will make
> the pom
>>> a little less readable. The choice should be configure all
> executions or
>>> just one, otherwise it starts getting too complicated.
>>>
>>> After looking into the current behavior a little more, it is possible
> to
>>> execute the same plugin goal twice in the same phase. So I think all
> the
>>> naming schemes proposed except maybe Brett's
>>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> future.
>>> But if we include a sequence number, then what happens if you add
> another
>>> execution of an existing plugin to the lifecycle? Do all the
> sequence
>>> numbers have to increment to make room?
>>>
>> Plus sequence number is non-deterministic. Also, you are
> forgetting... this
>> is not the id of executions *defined within the pom* but it's the id
> of
>> executions *defined by either the lifecycle or the plugin's mojo
> bindings*
>> I don't see how a mojo's descriptor can bind to any more than one
> phase, so
>> I guess the only thing preventing uniqueness is if the lifecycle can
> invoke
>> the same goal multiple times in the same phase... but hang on, how is
> that a
>> problem if we say that the execution is per phase (unless you want to
>> configure the different multiple executions differentially.... sounds
> like
>> you're writing a severe hack)
>>
>
> I just said that sequence numbers are the only way suggested that
> completely
> avoid id conflicts, but you're right it has other problems.
>
> I don't think it's a severe hack to have two executions for the same
> plugin goal
> in the same phase. For example, let's say I want to generate three jar
> files
> with different manifests during the package phase. I need to call the
> assembly
> or jar plugin three times with different configurations. I'm just
> saying it's
> possible to have this scenario even in a default lifecycle, so there is
> a small
> possibility of a name conflict even if we use something like
> lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
>>> I think if we add the goal name to the execution like Benjamin
> suggested,
>>> we will be unlikely to run into conflicts. So I would prefer
> something
>>> like:
>>>
>>> default-lifecycle-compile
>>> default-lifecycle-testCompile
>>>
>> No, what if I bind compile goal to the compile phase and
> process-classes?
>> Now I have an execution that is bound to two phases (not allowed) or
> two
>> executions with the same id (not allowed)
>>
>> I'm sorry, but I don't see how you can exclude the phase from the
>> execution's id...
>>
>> And given that phases consist of names separated by -, it seems
> confusing to
>> name them with - as a separator.
>>
>
> Adding the phase to the ID doesn't prevent name conflicts, since you can
> have
> the same goal twice in the same phase. I would guess it's actually be
> more
> common to have a goal twice in the same phase vs. in different phases.
> So I
> think the goal name is a better qualifier than the phase.
>
>> Now I don't mind if we do
>>
>> default-lifecycle:compile
>> default-lifecycle:test-compile
>>
>> or
>>
>> lifecycle:compile
>> lifecycle:test-compile
>>
>> or
>>
>> lifecycle:jar:compile
>> lifecycle:jar:test-compile
>>
>> or even use a different separator ('/' anyone?)
>>
>> The only advantage of specifying the packaging type is if you have a
> common
>> root pom. Wildcards only become really important if you use packaging
> in
>> the id, but there is still the issue of what if I need to specify
> something
>> for all executions (but keep the defaults outside of an execution
> different
>> for when executing goals directly from the command line)
>>
>> I can live without wildcards.
>>
>> Sequence numbers are either non-deterministic, or will end up having a
> 1:1
>> mapping with each phase, so why not just use the phase. Goal is
> non-unique,
>> and has the problem of multiple executions, and we can likely get away
> with
>> just phase anyway.
>>
>>
>>> When building, this logs to the command line like this:
>>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
I think we've gone way off the rails here. I see there's a proposal but
haven't reviewed it yet.
The first portion of this discussion was rather small in scope:
Currently default executions of plugins have a null id. The null is used
to indicate the default config for a plugin across all executions AND is
used for lifecycle bound or plugins run on the cli. I think we simply
should start by separating this. Keep default to replace the current
null values for the global plugin configuration as it applies across all
executions. Then define an id for the lifecycle and cli invocations to
be applied to tweak the values as needed (but keeping default to apply
across all). Going beyond this into multifaceted ids for packages etc is
far too complicated imo.
-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com]
Sent: Monday, November 10, 2008 3:44 PM
To: Maven Developers List
Subject: Re: Default plugin execution id
Stephen Connolly wrote:
> 2008/11/10 Paul Gier <pg...@redhat.com>
>
>> What about adding new syntax to the goal string? So that from the
command
>> line you could write something like this to refer to specific
execution
>> configs:
>>
>> mvn eclipse:eclipse{execution-1}
>> or
>> mvn eclipse:eclipse{execution-2}
>>
>
> How would that interact with the lifecycle?
>
> If I define execution-1 as attached to the compile phase, does that
mean
> that Maven will execute all phases upto compile and then just execute
> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring
any
> plugins that are attached to prior phases? (With the side effect that
I'd
> loose the information of the extra attached source directories)
>
> The more I think about it, calling out a specific execution *that has
been
> attached to a specific phase* is a bad bad pattern, and it's a good
thing
> that Maven does not let you do that.
>
> If you need to do a pile of every-so-often tasks I'd define them in
profiles
> with each profile attaching the plugins to the requisite phases and
defining
> the defaultGoals to the highest phase necessary.
>
>
>> The curly braces already seem to be associated with execution ids in
>> maven's logging output. This would mean that components.xml file in
maven
>> core could be changed to provide execution IDs for each plugin that
is
>> executed, but probably no one wants to manually update this all the
time.
>>
>> IMO the wildcard syntax is more than what is needed, and will make
the pom
>> a little less readable. The choice should be configure all
executions or
>> just one, otherwise it starts getting too complicated.
>>
>> After looking into the current behavior a little more, it is possible
to
>> execute the same plugin goal twice in the same phase. So I think all
the
>> naming schemes proposed except maybe Brett's
>> (groupId:artifactId:sequenceNumber) could run into conflicts in the
future.
>> But if we include a sequence number, then what happens if you add
another
>> execution of an existing plugin to the lifecycle? Do all the
sequence
>> numbers have to increment to make room?
>>
>
> Plus sequence number is non-deterministic. Also, you are
forgetting... this
> is not the id of executions *defined within the pom* but it's the id
of
> executions *defined by either the lifecycle or the plugin's mojo
bindings*
>
> I don't see how a mojo's descriptor can bind to any more than one
phase, so
> I guess the only thing preventing uniqueness is if the lifecycle can
invoke
> the same goal multiple times in the same phase... but hang on, how is
that a
> problem if we say that the execution is per phase (unless you want to
> configure the different multiple executions differentially.... sounds
like
> you're writing a severe hack)
>
I just said that sequence numbers are the only way suggested that
completely
avoid id conflicts, but you're right it has other problems.
I don't think it's a severe hack to have two executions for the same
plugin goal
in the same phase. For example, let's say I want to generate three jar
files
with different manifests during the package phase. I need to call the
assembly
or jar plugin three times with different configurations. I'm just
saying it's
possible to have this scenario even in a default lifecycle, so there is
a small
possibility of a name conflict even if we use something like
lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
>> I think if we add the goal name to the execution like Benjamin
suggested,
>> we will be unlikely to run into conflicts. So I would prefer
something
>> like:
>>
>> default-lifecycle-compile
>> default-lifecycle-testCompile
>>
>
> No, what if I bind compile goal to the compile phase and
process-classes?
>
> Now I have an execution that is bound to two phases (not allowed) or
two
> executions with the same id (not allowed)
>
> I'm sorry, but I don't see how you can exclude the phase from the
> execution's id...
>
> And given that phases consist of names separated by -, it seems
confusing to
> name them with - as a separator.
>
Adding the phase to the ID doesn't prevent name conflicts, since you can
have
the same goal twice in the same phase. I would guess it's actually be
more
common to have a goal twice in the same phase vs. in different phases.
So I
think the goal name is a better qualifier than the phase.
> Now I don't mind if we do
>
> default-lifecycle:compile
> default-lifecycle:test-compile
>
> or
>
> lifecycle:compile
> lifecycle:test-compile
>
> or
>
> lifecycle:jar:compile
> lifecycle:jar:test-compile
>
> or even use a different separator ('/' anyone?)
>
> The only advantage of specifying the packaging type is if you have a
common
> root pom. Wildcards only become really important if you use packaging
in
> the id, but there is still the issue of what if I need to specify
something
> for all executions (but keep the defaults outside of an execution
different
> for when executing goals directly from the command line)
>
> I can live without wildcards.
>
> Sequence numbers are either non-deterministic, or will end up having a
1:1
> mapping with each phase, so why not just use the phase. Goal is
non-unique,
> and has the problem of multiple executions, and we can likely get away
with
> just phase anyway.
>
>
>> When building, this logs to the command line like this:
>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
Stephen Connolly wrote:
> 2008/11/10 Paul Gier <pg...@redhat.com>
>
>> What about adding new syntax to the goal string? So that from the command
>> line you could write something like this to refer to specific execution
>> configs:
>>
>> mvn eclipse:eclipse{execution-1}
>> or
>> mvn eclipse:eclipse{execution-2}
>>
>
> How would that interact with the lifecycle?
>
> If I define execution-1 as attached to the compile phase, does that mean
> that Maven will execute all phases upto compile and then just execute
> eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring any
> plugins that are attached to prior phases? (With the side effect that I'd
> loose the information of the extra attached source directories)
>
> The more I think about it, calling out a specific execution *that has been
> attached to a specific phase* is a bad bad pattern, and it's a good thing
> that Maven does not let you do that.
>
> If you need to do a pile of every-so-often tasks I'd define them in profiles
> with each profile attaching the plugins to the requisite phases and defining
> the defaultGoals to the highest phase necessary.
>
>
>> The curly braces already seem to be associated with execution ids in
>> maven's logging output. This would mean that components.xml file in maven
>> core could be changed to provide execution IDs for each plugin that is
>> executed, but probably no one wants to manually update this all the time.
>>
>> IMO the wildcard syntax is more than what is needed, and will make the pom
>> a little less readable. The choice should be configure all executions or
>> just one, otherwise it starts getting too complicated.
>>
>> After looking into the current behavior a little more, it is possible to
>> execute the same plugin goal twice in the same phase. So I think all the
>> naming schemes proposed except maybe Brett's
>> (groupId:artifactId:sequenceNumber) could run into conflicts in the future.
>> But if we include a sequence number, then what happens if you add another
>> execution of an existing plugin to the lifecycle? Do all the sequence
>> numbers have to increment to make room?
>>
>
> Plus sequence number is non-deterministic. Also, you are forgetting... this
> is not the id of executions *defined within the pom* but it's the id of
> executions *defined by either the lifecycle or the plugin's mojo bindings*
>
> I don't see how a mojo's descriptor can bind to any more than one phase, so
> I guess the only thing preventing uniqueness is if the lifecycle can invoke
> the same goal multiple times in the same phase... but hang on, how is that a
> problem if we say that the execution is per phase (unless you want to
> configure the different multiple executions differentially.... sounds like
> you're writing a severe hack)
>
I just said that sequence numbers are the only way suggested that completely
avoid id conflicts, but you're right it has other problems.
I don't think it's a severe hack to have two executions for the same plugin goal
in the same phase. For example, let's say I want to generate three jar files
with different manifests during the package phase. I need to call the assembly
or jar plugin three times with different configurations. I'm just saying it's
possible to have this scenario even in a default lifecycle, so there is a small
possibility of a name conflict even if we use something like
lifecycle-<packaging>-<phase>-<plugin>-<goal>
>
>> I think if we add the goal name to the execution like Benjamin suggested,
>> we will be unlikely to run into conflicts. So I would prefer something
>> like:
>>
>> default-lifecycle-compile
>> default-lifecycle-testCompile
>>
>
> No, what if I bind compile goal to the compile phase and process-classes?
>
> Now I have an execution that is bound to two phases (not allowed) or two
> executions with the same id (not allowed)
>
> I'm sorry, but I don't see how you can exclude the phase from the
> execution's id...
>
> And given that phases consist of names separated by -, it seems confusing to
> name them with - as a separator.
>
Adding the phase to the ID doesn't prevent name conflicts, since you can have
the same goal twice in the same phase. I would guess it's actually be more
common to have a goal twice in the same phase vs. in different phases. So I
think the goal name is a better qualifier than the phase.
> Now I don't mind if we do
>
> default-lifecycle:compile
> default-lifecycle:test-compile
>
> or
>
> lifecycle:compile
> lifecycle:test-compile
>
> or
>
> lifecycle:jar:compile
> lifecycle:jar:test-compile
>
> or even use a different separator ('/' anyone?)
>
> The only advantage of specifying the packaging type is if you have a common
> root pom. Wildcards only become really important if you use packaging in
> the id, but there is still the issue of what if I need to specify something
> for all executions (but keep the defaults outside of an execution different
> for when executing goals directly from the command line)
>
> I can live without wildcards.
>
> Sequence numbers are either non-deterministic, or will end up having a 1:1
> mapping with each phase, so why not just use the phase. Goal is non-unique,
> and has the problem of multiple executions, and we can likely get away with
> just phase anyway.
>
>
>> When building, this logs to the command line like this:
>> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
2008/11/10 Paul Gier <pg...@redhat.com>
> What about adding new syntax to the goal string? So that from the command
> line you could write something like this to refer to specific execution
> configs:
>
> mvn eclipse:eclipse{execution-1}
> or
> mvn eclipse:eclipse{execution-2}
>
How would that interact with the lifecycle?
If I define execution-1 as attached to the compile phase, does that mean
that Maven will execute all phases upto compile and then just execute
eclipse:eclipse, or is it just executing eclipse:eclipse and ignoring any
plugins that are attached to prior phases? (With the side effect that I'd
loose the information of the extra attached source directories)
The more I think about it, calling out a specific execution *that has been
attached to a specific phase* is a bad bad pattern, and it's a good thing
that Maven does not let you do that.
If you need to do a pile of every-so-often tasks I'd define them in profiles
with each profile attaching the plugins to the requisite phases and defining
the defaultGoals to the highest phase necessary.
>
> The curly braces already seem to be associated with execution ids in
> maven's logging output. This would mean that components.xml file in maven
> core could be changed to provide execution IDs for each plugin that is
> executed, but probably no one wants to manually update this all the time.
>
> IMO the wildcard syntax is more than what is needed, and will make the pom
> a little less readable. The choice should be configure all executions or
> just one, otherwise it starts getting too complicated.
>
> After looking into the current behavior a little more, it is possible to
> execute the same plugin goal twice in the same phase. So I think all the
> naming schemes proposed except maybe Brett's
> (groupId:artifactId:sequenceNumber) could run into conflicts in the future.
> But if we include a sequence number, then what happens if you add another
> execution of an existing plugin to the lifecycle? Do all the sequence
> numbers have to increment to make room?
>
Plus sequence number is non-deterministic. Also, you are forgetting... this
is not the id of executions *defined within the pom* but it's the id of
executions *defined by either the lifecycle or the plugin's mojo bindings*
I don't see how a mojo's descriptor can bind to any more than one phase, so
I guess the only thing preventing uniqueness is if the lifecycle can invoke
the same goal multiple times in the same phase... but hang on, how is that a
problem if we say that the execution is per phase (unless you want to
configure the different multiple executions differentially.... sounds like
you're writing a severe hack)
> I think if we add the goal name to the execution like Benjamin suggested,
> we will be unlikely to run into conflicts. So I would prefer something
> like:
>
> default-lifecycle-compile
> default-lifecycle-testCompile
>
No, what if I bind compile goal to the compile phase and process-classes?
Now I have an execution that is bound to two phases (not allowed) or two
executions with the same id (not allowed)
I'm sorry, but I don't see how you can exclude the phase from the
execution's id...
And given that phases consist of names separated by -, it seems confusing to
name them with - as a separator.
Now I don't mind if we do
default-lifecycle:compile
default-lifecycle:test-compile
or
lifecycle:compile
lifecycle:test-compile
or
lifecycle:jar:compile
lifecycle:jar:test-compile
or even use a different separator ('/' anyone?)
The only advantage of specifying the packaging type is if you have a common
root pom. Wildcards only become really important if you use packaging in
the id, but there is still the issue of what if I need to specify something
for all executions (but keep the defaults outside of an execution different
for when executing goals directly from the command line)
I can live without wildcards.
Sequence numbers are either non-deterministic, or will end up having a 1:1
mapping with each phase, so why not just use the phase. Goal is non-unique,
and has the problem of multiple executions, and we can likely get away with
just phase anyway.
> When building, this logs to the command line like this:
> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: Default plugin execution id
Posted by Jason van Zyl <jv...@sonatype.com>.
-1
Handling one offs from the command line is not what we want.
Executions embedded into the lifecycle are meant to be just that a way
to include many things you need in the lifecycle.
If you need something different on a per situation basis it should be
a plugin configuration that you need encapsulated in a profile.
This would just create another confusing way to achieve something on
the command line and and supporting this in IDEs would also be
loathsome.
On 10-Nov-08, at 2:43 PM, Paul Gier wrote:
> Christian Schulte wrote:
>> Stephen Connolly wrote:
>>> AFAIK,
>>>
>>> The execution id refers only to a specific plugin, and each
>>> execution can
>>> only match a specific phase... so I don't see the need to tie the
>>> execution
>>> to a goal name, neither to the plugin name...
>>>
>>> What I see as bind important is if the plugin is bound to multiple
>>> phases
>>> and you want to configure the different phases differently...
>>>
>>> At that point I think you're left with "breaking" the id as an
>>> id.... and
>>> you'd end up using a wild-card type matching, e.g.
>>>
>>> <id>lifecycle:jar:*</id>
>>>
>>> or
>>>
>>> <id>lifecycle:*:compile</id>
>>>
>>> or
>>>
>>> <id>lifecycle:*:*</id>
>>>
>>> All of which are useful, and do not require a schema change, and
>>> are rather
>>> unlikely to interfere with existing builds... but it feels ugly to
>>> me... and
>>> yet I'm proposing it! ;-)
>>>
>> There must not necessarily be a lifecycle in use at all. How would
>> this
>> execution id match standalone executions ? E.g.
>> mvn eclipse:eclipse
>> mvn netbeans-freeform:generate-netbeans-project
>> Consider a plugin with multiple such standalone goals for which a
>> user
>> needs to provide configurations per goal. Neither the lifecycle nor
>> the
>> packaging plays any role here, I think. E.g.
>> mvn ide:eclipse
>> mvn ide:netbeans-freeform
>> <id>none:*:none</id> ?
>
> What about adding new syntax to the goal string? So that from the
> command line you could write something like this to refer to
> specific execution configs:
>
> mvn eclipse:eclipse{execution-1}
> or
> mvn eclipse:eclipse{execution-2}
>
> The curly braces already seem to be associated with execution ids in
> maven's logging output. This would mean that components.xml file in
> maven core could be changed to provide execution IDs for each plugin
> that is executed, but probably no one wants to manually update this
> all the time.
>
> IMO the wildcard syntax is more than what is needed, and will make
> the pom a little less readable. The choice should be configure all
> executions or just one, otherwise it starts getting too complicated.
>
> After looking into the current behavior a little more, it is
> possible to execute the same plugin goal twice in the same phase.
> So I think all the naming schemes proposed except maybe Brett's
> (groupId:artifactId:sequenceNumber) could run into conflicts in the
> future. But if we include a sequence number, then what happens if
> you add another execution of an existing plugin to the lifecycle?
> Do all the sequence numbers have to increment to make room?
>
> I think if we add the goal name to the execution like Benjamin
> suggested, we will be unlikely to run into conflicts. So I would
> prefer something like:
>
> default-lifecycle-compile
> default-lifecycle-testCompile
>
> When building, this logs to the command line like this:
> [INFO] [compiler:compile {execution: default-lifecycle-compile}]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
First, the taking in of scattered particulars under one Idea,
so that everyone understands what is being talked about ... Second,
the separation of the Idea into parts, by dividing it at the joints,
as nature directs, not breaking any limb in half as a bad carver might.
-- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
Christian Schulte wrote:
> Stephen Connolly wrote:
>> AFAIK,
>>
>> The execution id refers only to a specific plugin, and each execution can
>> only match a specific phase... so I don't see the need to tie the execution
>> to a goal name, neither to the plugin name...
>>
>> What I see as bind important is if the plugin is bound to multiple phases
>> and you want to configure the different phases differently...
>>
>> At that point I think you're left with "breaking" the id as an id.... and
>> you'd end up using a wild-card type matching, e.g.
>>
>> <id>lifecycle:jar:*</id>
>>
>> or
>>
>> <id>lifecycle:*:compile</id>
>>
>> or
>>
>> <id>lifecycle:*:*</id>
>>
>> All of which are useful, and do not require a schema change, and are rather
>> unlikely to interfere with existing builds... but it feels ugly to me... and
>> yet I'm proposing it! ;-)
>>
>
> There must not necessarily be a lifecycle in use at all. How would this
> execution id match standalone executions ? E.g.
>
> mvn eclipse:eclipse
> mvn netbeans-freeform:generate-netbeans-project
>
> Consider a plugin with multiple such standalone goals for which a user
> needs to provide configurations per goal. Neither the lifecycle nor the
> packaging plays any role here, I think. E.g.
>
> mvn ide:eclipse
> mvn ide:netbeans-freeform
>
> <id>none:*:none</id> ?
>
What about adding new syntax to the goal string? So that from the command line
you could write something like this to refer to specific execution configs:
mvn eclipse:eclipse{execution-1}
or
mvn eclipse:eclipse{execution-2}
The curly braces already seem to be associated with execution ids in maven's
logging output. This would mean that components.xml file in maven core could be
changed to provide execution IDs for each plugin that is executed, but probably
no one wants to manually update this all the time.
IMO the wildcard syntax is more than what is needed, and will make the pom a
little less readable. The choice should be configure all executions or just
one, otherwise it starts getting too complicated.
After looking into the current behavior a little more, it is possible to execute
the same plugin goal twice in the same phase. So I think all the naming schemes
proposed except maybe Brett's (groupId:artifactId:sequenceNumber) could run into
conflicts in the future. But if we include a sequence number, then what happens
if you add another execution of an existing plugin to the lifecycle? Do all the
sequence numbers have to increment to make room?
I think if we add the goal name to the execution like Benjamin suggested, we
will be unlikely to run into conflicts. So I would prefer something like:
default-lifecycle-compile
default-lifecycle-testCompile
When building, this logs to the command line like this:
[INFO] [compiler:compile {execution: default-lifecycle-compile}]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Stephen Connolly wrote:
> AFAIK,
>
> The execution id refers only to a specific plugin, and each execution can
> only match a specific phase... so I don't see the need to tie the execution
> to a goal name, neither to the plugin name...
>
> What I see as bind important is if the plugin is bound to multiple phases
> and you want to configure the different phases differently...
>
> At that point I think you're left with "breaking" the id as an id.... and
> you'd end up using a wild-card type matching, e.g.
>
> <id>lifecycle:jar:*</id>
>
> or
>
> <id>lifecycle:*:compile</id>
>
> or
>
> <id>lifecycle:*:*</id>
>
> All of which are useful, and do not require a schema change, and are rather
> unlikely to interfere with existing builds... but it feels ugly to me... and
> yet I'm proposing it! ;-)
>
There must not necessarily be a lifecycle in use at all. How would this
execution id match standalone executions ? E.g.
mvn eclipse:eclipse
mvn netbeans-freeform:generate-netbeans-project
Consider a plugin with multiple such standalone goals for which a user
needs to provide configurations per goal. Neither the lifecycle nor the
packaging plays any role here, I think. E.g.
mvn ide:eclipse
mvn ide:netbeans-freeform
<id>none:*:none</id> ?
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
AFAIK,
The execution id refers only to a specific plugin, and each execution can
only match a specific phase... so I don't see the need to tie the execution
to a goal name, neither to the plugin name...
What I see as bind important is if the plugin is bound to multiple phases
and you want to configure the different phases differently...
At that point I think you're left with "breaking" the id as an id.... and
you'd end up using a wild-card type matching, e.g.
<id>lifecycle:jar:*</id>
or
<id>lifecycle:*:compile</id>
or
<id>lifecycle:*:*</id>
All of which are useful, and do not require a schema change, and are rather
unlikely to interfere with existing builds... but it feels ugly to me... and
yet I'm proposing it! ;-)
-Stephen
2008/11/9 Brian E. Fox <br...@reply.infinity.nu>
> That's a bad example and what if you want to provide defaults for both?
>
> -----Original Message-----
> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu]
> Sent: Sunday, November 09, 2008 6:27 AM
> To: Maven Developers List
> Subject: Re: Default plugin execution id
>
> Jason van Zyl wrote:
>
> > I don't think anyone is generally going to type:
> >
> > default-execution-id
>
> As said before, I believe it's nice to distinguish executions of
> different plugin goals to allow their separate configuration. So how
> about appending the goal name like
>
> default-execution-compile
> default-execution-testCompile
>
> ?
>
>
> Benjamin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
That's a bad example and what if you want to provide defaults for both?
-----Original Message-----
From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu]
Sent: Sunday, November 09, 2008 6:27 AM
To: Maven Developers List
Subject: Re: Default plugin execution id
Jason van Zyl wrote:
> I don't think anyone is generally going to type:
>
> default-execution-id
As said before, I believe it's nice to distinguish executions of
different plugin goals to allow their separate configuration. So how
about appending the goal name like
default-execution-compile
default-execution-testCompile
?
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
how about lifecycle:[packaging]:[phase]
e.g. lifecycle:jar:compile and lifecycle:jar:test-compile
this would have the side-effect that you might need to override both
lifecycle:jar:compile and lifecycle:war:compile to alter all compile
settings, but I see plusses to that too
Sent from my iPod
On 9 Nov 2008, at 11:26, Benjamin Bentmann <be...@udo.edu>
wrote:
> Jason van Zyl wrote:
>
>> I don't think anyone is generally going to type:
>> default-execution-id
>
> As said before, I believe it's nice to distinguish executions of
> different plugin goals to allow their separate configuration. So how
> about appending the goal name like
>
> default-execution-compile
> default-execution-testCompile
>
> ?
>
>
> Benjamin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Benjamin Bentmann <be...@udo.edu>.
Jason van Zyl wrote:
> I don't think anyone is generally going to type:
>
> default-execution-id
As said before, I believe it's nice to distinguish executions of
different plugin goals to allow their separate configuration. So how
about appending the goal name like
default-execution-compile
default-execution-testCompile
?
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Jason van Zyl <jv...@sonatype.com>.
I don't think anyone is generally going to type:
default-execution-id
It says what it is and if someone happens to look at the effective POM
they will understand. It's also unlikely someone would actually use
that in their own POMs.
On 8-Nov-08, at 2:23 AM, Benjamin Bentmann wrote:
> Brett Porter wrote:
>
>> How about #groupId:artifactId:sequenceNumber.
>
> What would be the sequenceNumber part? This kind of execution config
> is surely an edge case but I would prefer the execution id to not be
> too complex/cryptic (someday I might want to type it into the POM...).
>
>> It would be unique to the POM.
>
> AFAIK, execution ids were meant to assist in merging inherited
> configuration. As this happens on a per plugin basis, we don't have
> need for ids which are unique to the entire POM, do we?
>
> Besides, I start wondering how this relates to MNG-3203. Assuming
> for a moment
> a) there is one execution per plugin goal and
> b) the implicit execution ids where equal to the executed plugin goal
> it seems something like
>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <executions>
> <execution>
> <id>compile</id>
> <configuration>
> <!-- parameters for main compilation here -->
> </configuration>
> </execution>
> <execution>
> <id>testCompile</id>
> <configuration>
> <!-- parameters for test compilation here -->
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> would naturally extend Paul's original use case.
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
the course of true love never did run smooth ...
-- Shakespeare
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Benjamin Bentmann <be...@udo.edu>.
Brett Porter wrote:
> How about #groupId:artifactId:sequenceNumber.
What would be the sequenceNumber part? This kind of execution config is
surely an edge case but I would prefer the execution id to not be too
complex/cryptic (someday I might want to type it into the POM...).
> It would be unique to the POM.
AFAIK, execution ids were meant to assist in merging inherited
configuration. As this happens on a per plugin basis, we don't have need
for ids which are unique to the entire POM, do we?
Besides, I start wondering how this relates to MNG-3203. Assuming for a
moment
a) there is one execution per plugin goal and
b) the implicit execution ids where equal to the executed plugin goal
it seems something like
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<configuration>
<!-- parameters for main compilation here -->
</configuration>
</execution>
<execution>
<id>testCompile</id>
<configuration>
<!-- parameters for test compilation here -->
</configuration>
</execution>
</executions>
</plugin>
would naturally extend Paul's original use case.
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Benjamin Bentmann wrote:
> Christian Schulte wrote:
>
>> Not having specified an execution id does not necessarily mean someone
>> did not care about it. It means someone explicitly referred to the
>> default execution.
>
> I disagree with this interpretation, mainly because I am not aware of
> any docs that would indicate this to the user.
To me that is more intuitive than having to deal with that id at all, if
all I want to do is to configure what Maven executes by default.
> The "Maven Model" [0] and the corresponding XSD [1] say about the
> execution id:
>
>> The identifier of this execution for labelling the goals during the build, and for matching executions to merge during inheritance.
>
> This description does not mention that the id "default" is meant to
> refer to executions provided by lifecycle mappings from a packaging type.
> The "POM Reference" [2] likewise does not state that there are special
> ids available to refer to default executions. And from the "Introduction
> to the Build Lifecycle" [3]:
>
>> Separate executions can also be given an ID so that during inheritance or the application of profiles you can control whether goal configuration is merged or turned into an additional execution.
>
> This expresses the id's purpose to assist in
> a) inheritance and
> b) profile injection
> Again, it's not stated that it can be used to control the executions
> provided by a packaging type. In particular, the phrase "executions
> *can* [...] be given an ID" merely expresses the ID is optional, not
> that omitting it refers to the default executions of a plugin.
Technically there seems to be a difference between executions introduced
by the lifecycle vs. executions explicitly defined in the pom or
initiated by a user on the command line. I see it more from a user
standpoint where one does not even care about why a plugin is executed
in a specific phase at all. So when Maven executes something by default,
for me that is a default execution I know nothing about how to refer to
it. So even <id>default</id> is not that intuitive than just omitting
the id and let Maven do the right thing.
>> That is not working in Maven 2.0.x and that's the bug
>> to fix. A POM which relies on that bug needs to get fixed.
>
> Considering the references I gave above, IMHO this is a design weakness,
> not a bug. This hairsplitting is not because I want to simply reduce our
> bug stats but because there is a subtle difference with regard to a
> user's expectations. Spoken laxly, a bug is "should work as per spec but
> actually doesn't" while here we have "would be nice to work but
> currently isn't supported".
>
> Hence, I don't see a foundation to require users that currently omit the
> execution ids to "fix" their "broken" POMs because we retrospectively
> changed the semantics. Choosing a fresh identifier as suggested by
> others before instead of "default" is less likely to break existing builds.
Hmm, the spec was the reason I changed my mind. Take a look at my first
post to this thread. There I suggested
org.apache.maven/2.1
to use as the execution id. Then I took a look at the spec of the POM
which for me is the XML schema and noticed that it explicitly defines
the execution id as "default" if not given. I assumed that an execution
with an identifier of "default" refers to what is executed by default.
If "default" does not identify the default execution, then I
misunderstood its meaning. So when you say one cannot use "default"
because its not specified anywhere, I say one must use "default" because
that is what the specification states, even if that potentially breaks
with 2.0 builds. I changed my mind on org.apache.maven/2.1 after having
read the specification.
So my point is using "default" because that is closer to the spec and
because that makes Maven intuitively do the right thing. The latter
being totally subjective, of course. If that breaks with 2.0, I am fine
with that because it subjectively is a step in the right direction.
Whatsoever, the docs do not mention that the execution id can be used to
refer to what Maven executes by default. No matter what the new value
will become (default-execution-id or whatever) would also need to be
mentioned in the docs. I thought it would be best if someone could just
say: Its not mentioned in the docs but it was mentioned in the XML
schema ever since.
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Benjamin Bentmann <be...@udo.edu>.
Christian Schulte wrote:
> Not having specified an execution id does not necessarily mean someone
> did not care about it. It means someone explicitly referred to the
> default execution.
I disagree with this interpretation, mainly because I am not aware of
any docs that would indicate this to the user.
The "Maven Model" [0] and the corresponding XSD [1] say about the
execution id:
> The identifier of this execution for labelling the goals during the build, and for matching executions to merge during inheritance.
This description does not mention that the id "default" is meant to
refer to executions provided by lifecycle mappings from a packaging type.
The "POM Reference" [2] likewise does not state that there are special
ids available to refer to default executions. And from the "Introduction
to the Build Lifecycle" [3]:
> Separate executions can also be given an ID so that during inheritance or the application of profiles you can control whether goal configuration is merged or turned into an additional execution.
This expresses the id's purpose to assist in
a) inheritance and
b) profile injection
Again, it's not stated that it can be used to control the executions
provided by a packaging type. In particular, the phrase "executions
*can* [...] be given an ID" merely expresses the ID is optional, not
that omitting it refers to the default executions of a plugin.
> That is not working in Maven 2.0.x and that's the bug
> to fix. A POM which relies on that bug needs to get fixed.
Considering the references I gave above, IMHO this is a design weakness,
not a bug. This hairsplitting is not because I want to simply reduce our
bug stats but because there is a subtle difference with regard to a
user's expectations. Spoken laxly, a bug is "should work as per spec but
actually doesn't" while here we have "would be nice to work but
currently isn't supported".
Hence, I don't see a foundation to require users that currently omit the
execution ids to "fix" their "broken" POMs because we retrospectively
changed the semantics. Choosing a fresh identifier as suggested by
others before instead of "default" is less likely to break existing builds.
Benjamin
[0]
http://maven.apache.org/ref/current/maven-model/maven.html#class_execution
[1] http://maven.apache.org/xsd/maven-4.0.0.xsd
[2] http://maven.apache.org/pom.html#Plugins
[3]
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Plugins
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Benjamin Bentmann wrote:
> However, given that POM snippets without execution id like
>
> <execution>
> <phase>foo</phase>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
>
> might not be uncommon, i.e. where one doesn't care about the execution
> id and simply relies on the schema-provided default value, it seems
> advisable to not use "default" as the id to avoid accidental clashes of
> executions that were originally distinct.
Not having specified an execution id does not necessarily mean someone
did not care about it. It means someone explicitly referred to the
default execution. That is not working in Maven 2.0.x and that's the bug
to fix. A POM which relies on that bug needs to get fixed. At least for
>= 2.1.
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Benjamin Bentmann <be...@udo.edu>.
Christian Schulte wrote:
> <xs:element name="id" minOccurs="0" type="xs:string" default="default">
> ^^^^^^^^^^^^^^^^^
> <xs:annotation>
> <xs:documentation source="version">4.0.0</xs:documentation>
> <xs:documentation source="description">
> The identifier of this execution for labelling the goals during
> the build, and for matching executions to merge during
> inheritance.</xs:documentation>
> </xs:annotation>
> </xs:element>
>
> If I got it right, one cannot use anything other than what is specified
> in the XML schema as the default for the execution id. At least not
> without changing the schema (e.g. removing that default="default" so
> that an application can test for the existence of an execution id).
The schema is not really of relevance here. It merely defines an id for
executions defined explicitly by the user in the POM. In constrast, the
id we are talking about here is the id that is assigned to executions
which are implicitly defined by lifecycle mappings for a particular
packaging type.
However, given that POM snippets without execution id like
<execution>
<phase>foo</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
might not be uncommon, i.e. where one doesn't care about the execution
id and simply relies on the schema-provided default value, it seems
advisable to not use "default" as the id to avoid accidental clashes of
executions that were originally distinct.
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Brett Porter wrote:
> How about #groupId:artifactId:sequenceNumber.
>
> It would be unique to the POM.
>
<xs:element name="id" minOccurs="0" type="xs:string" default="default">
^^^^^^^^^^^^^^^^^
<xs:annotation>
<xs:documentation source="version">4.0.0</xs:documentation>
<xs:documentation source="description">
The identifier of this execution for labelling the goals during
the build, and for matching executions to merge during
inheritance.</xs:documentation>
</xs:annotation>
</xs:element>
If I got it right, one cannot use anything other than what is specified
in the XML schema as the default for the execution id. At least not
without changing the schema (e.g. removing that default="default" so
that an application can test for the existence of an execution id).
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Brett Porter <br...@apache.org>.
How about #groupId:artifactId:sequenceNumber.
It would be unique to the POM.
On 07/11/2008, at 10:09 PM, Christian Schulte wrote:
> Brian E. Fox wrote:
>> Definitely 2.1 and that way if there is a conflict, it's part of
>> moving
>> forward. Is there a name besides default that might be less likely to
>> conflict?
>>
>
> org.apache.maven/2.1 ?
>
> --
> Christian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Christian Schulte <cs...@schulte.it>.
Brian E. Fox wrote:
> Definitely 2.1 and that way if there is a conflict, it's part of moving
> forward. Is there a name besides default that might be less likely to
> conflict?
>
org.apache.maven/2.1 ?
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Definitely 2.1 and that way if there is a conflict, it's part of moving
forward. Is there a name besides default that might be less likely to
conflict?
-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com]
Sent: Friday, November 07, 2008 4:18 PM
To: Maven Developers List
Subject: Re: Default plugin execution id
Ok thanks, I attached a patch which is just a one line change to set the
execution id to "default" if nothing is specified.
It fixes the issue for me, but I guess the concern is that it could
change the
behaviour for anyone currently using an id of "default" or not using an
execution id. So I'm not sure if this is something that could go into
2.0.x or
has to wait until 2.1.
Brian E. Fox wrote:
> Yes, this is needed. I have a jira somewhere for it...
> http://jira.codehaus.org/browse/MNG-3401
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Friday, November 07, 2008 3:46 PM
> To: Maven Developers List
> Subject: Default plugin execution id
>
> Hi everyone,
>
> I'd like to be able to configure the default execution of a plugin
> within an
> execution instead of doing it through the main plugin configuration.
So
> the
> result would look something like this:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <id>default</id>
> <configuration>
> <includes>
> <include>stuff/**</include>
> </includes>
> </configuration>
> </execution>
> <execution>
> <id>custom</id>
> <configuration>
> <includes>
> <include>other-stuff/**</include>
> </includes>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> Currently, it seems the only way to configure the default jar plugin
> execution
> is to use the main plugin configuration section. This doesn't work as
> well
> because it ends up applying the config to all executions, which is not
> always
> what is needed.
>
> Benjamin pointed me to the MojoExceution constructor which sets the id
> to null,
> and PluginExecution from the model which sets the id to "default".
This
>
> difference seems to be why the default executions can't be overridden
in
> an
> execution config.
>
> Any thoughts? I'll create a jira issue with a patch for this, but
I'll
> wait for
> feedback before changing anything.
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Stephen Connolly <st...@gmail.com>.
I've updated the page to include my counter-proposal
2008/11/10 Paul Gier <pg...@redhat.com>
> I created a user proposal to hopefully clarify the issue and my proposed
> solution:
> http://docs.codehaus.org/display/MAVENUSER/Default+Plugin+Execution+IDs
>
>
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
I created a user proposal to hopefully clarify the issue and my proposed solution:
http://docs.codehaus.org/display/MAVENUSER/Default+Plugin+Execution+IDs
Paul Gier wrote:
> Ok thanks, I attached a patch which is just a one line change to set the
> execution id to "default" if nothing is specified.
>
> It fixes the issue for me, but I guess the concern is that it could
> change the behaviour for anyone currently using an id of "default" or
> not using an execution id. So I'm not sure if this is something that
> could go into 2.0.x or has to wait until 2.1.
>
> Brian E. Fox wrote:
>> Yes, this is needed. I have a jira somewhere for it...
>> http://jira.codehaus.org/browse/MNG-3401
>>
>>
>> -----Original Message-----
>> From: Paul Gier [mailto:pgier@redhat.com] Sent: Friday, November 07,
>> 2008 3:46 PM
>> To: Maven Developers List
>> Subject: Default plugin execution id
>>
>> Hi everyone,
>>
>> I'd like to be able to configure the default execution of a plugin
>> within an execution instead of doing it through the main plugin
>> configuration. So
>> the result would look something like this:
>>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-jar-plugin</artifactId>
>> <executions>
>> <execution>
>> <id>default</id>
>> <configuration>
>> <includes>
>> <include>stuff/**</include>
>> </includes>
>> </configuration>
>> </execution>
>> <execution>
>> <id>custom</id>
>> <configuration>
>> <includes>
>> <include>other-stuff/**</include>
>> </includes>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>>
>> Currently, it seems the only way to configure the default jar plugin
>> execution is to use the main plugin configuration section. This
>> doesn't work as
>> well because it ends up applying the config to all executions, which
>> is not
>> always what is needed.
>>
>> Benjamin pointed me to the MojoExceution constructor which sets the id
>> to null, and PluginExecution from the model which sets the id to
>> "default". This
>>
>> difference seems to be why the default executions can't be overridden in
>> an execution config.
>>
>> Any thoughts? I'll create a jira issue with a patch for this, but I'll
>> wait for feedback before changing anything.
>>
>> Thanks!
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Default plugin execution id
Posted by Paul Gier <pg...@redhat.com>.
Ok thanks, I attached a patch which is just a one line change to set the
execution id to "default" if nothing is specified.
It fixes the issue for me, but I guess the concern is that it could change the
behaviour for anyone currently using an id of "default" or not using an
execution id. So I'm not sure if this is something that could go into 2.0.x or
has to wait until 2.1.
Brian E. Fox wrote:
> Yes, this is needed. I have a jira somewhere for it...
> http://jira.codehaus.org/browse/MNG-3401
>
>
> -----Original Message-----
> From: Paul Gier [mailto:pgier@redhat.com]
> Sent: Friday, November 07, 2008 3:46 PM
> To: Maven Developers List
> Subject: Default plugin execution id
>
> Hi everyone,
>
> I'd like to be able to configure the default execution of a plugin
> within an
> execution instead of doing it through the main plugin configuration. So
> the
> result would look something like this:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <id>default</id>
> <configuration>
> <includes>
> <include>stuff/**</include>
> </includes>
> </configuration>
> </execution>
> <execution>
> <id>custom</id>
> <configuration>
> <includes>
> <include>other-stuff/**</include>
> </includes>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> Currently, it seems the only way to configure the default jar plugin
> execution
> is to use the main plugin configuration section. This doesn't work as
> well
> because it ends up applying the config to all executions, which is not
> always
> what is needed.
>
> Benjamin pointed me to the MojoExceution constructor which sets the id
> to null,
> and PluginExecution from the model which sets the id to "default". This
>
> difference seems to be why the default executions can't be overridden in
> an
> execution config.
>
> Any thoughts? I'll create a jira issue with a patch for this, but I'll
> wait for
> feedback before changing anything.
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Default plugin execution id
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Yes, this is needed. I have a jira somewhere for it...
http://jira.codehaus.org/browse/MNG-3401
-----Original Message-----
From: Paul Gier [mailto:pgier@redhat.com]
Sent: Friday, November 07, 2008 3:46 PM
To: Maven Developers List
Subject: Default plugin execution id
Hi everyone,
I'd like to be able to configure the default execution of a plugin
within an
execution instead of doing it through the main plugin configuration. So
the
result would look something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default</id>
<configuration>
<includes>
<include>stuff/**</include>
</includes>
</configuration>
</execution>
<execution>
<id>custom</id>
<configuration>
<includes>
<include>other-stuff/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
Currently, it seems the only way to configure the default jar plugin
execution
is to use the main plugin configuration section. This doesn't work as
well
because it ends up applying the config to all executions, which is not
always
what is needed.
Benjamin pointed me to the MojoExceution constructor which sets the id
to null,
and PluginExecution from the model which sets the id to "default". This
difference seems to be why the default executions can't be overridden in
an
execution config.
Any thoughts? I'll create a jira issue with a patch for this, but I'll
wait for
feedback before changing anything.
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org