You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Gi...@b-source.ch on 2010/06/14 18:20:26 UTC

How to get the execution id from a plugin

Hi all,

I've already sent this question to the users list... but probably was
the wrong place ;-)

Anyway, I'm writing a Maven plugin:

public class MyMojo extends AbstractMojo {

   ...

   private void execute() throws MojoExecutionException
   {
       /* I need to get the execution id here */
   }
}

... and given the following POM, I'm wondering how can I retrieve the
execution id from it:

<project>
    <build>
        <plugins>
            <groupId>ch.bsource.plugins</groupId>
            <artifactId>my-plugin</artifactId>
            <version>RELEASE</version>
            <executions>
                <id>my-execution-id</id> <!-- I want to get this -->
                <goals>
                    <goal>mygoal</goal>
                </goals>
                <configuration>
                    ...
                </configuration>
            </executions>
        </plugins>
    </build>
</project>


Any help would be really appreciated.
Jeff

Giuseppe Greco
Application Architect - System Integration & Applications

B-Source SA, Via Simen 14, CH-6900 Lugano
Tel. +41 58 806 56 42 Fax +41 58 806 50 01
giuseppe.greco@b-source.ch - www.b-source.ch

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: How to get the execution id from a plugin

Posted by Martin Gainty <mg...@hotmail.com>.
no..if your plugin is bound to a phase of the default-lifecycle (unless overidden at command-line)

 

i dont know if this requested enhancement has been coded?

http://docs.codehaus.org/display/MAVENUSER/Default+Plugin+Execution+IDs


is there an enhancement underway?
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Tue, 15 Jun 2010 15:48:47 +0200
> From: benjamin.bentmann@udo.edu
> To: dev@maven.apache.org
> Subject: Re: How to get the execution id from a plugin
> 
> Giuseppe.Greco wrote:
> 
> > private void execute() throws MojoExecutionException
> > {
> > /* I need to get the execution id here */
> > }
> 
> /**
> * @parameter default-value="${mojoExecution}"
> * @readonly
> */
> private MojoExecution mojoExecution;
> 
> and
> 
> mojoExecution.getId();
> 
> should do. I only can't tell since what Maven version that works.
> 
> 
> Benjamin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

RE: How to get the execution id from a plugin

Posted by Gi...@b-source.ch.
Guy,

It works! Thank you very much for your help.

Cheers,
Jeff

> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
> Sent: Tuesday, June 15, 2010 5:36 PM
> To: Maven Developers List
> Subject: Re: How to get the execution id from a plugin
> 
> 
> On 15 June 2010 16:31, <Gi...@b-source.ch> wrote:
> 
> > Finally I was able to compile it... but it does not work. I 
> created a
> > base class like this:
> >
> > public abstract class ContextAbstractMojo extends AbstractMojo {
> >
> >    /**
> >     * The execution ID as defined in the POM.
> >      *
> >     * @parameter default-value="${mojoExecution}}"
> >
> 
> you have a syntax error here, try using only one closing }
> 
> 
> >     * @readonly
> >     */
> >     private MojoExecution execution;
> >
> >    /**
> >     * The context ID as an alternative to the execution ID.
> >     */
> >    //private String context;
> >
> >    /**
> >     * Gets the execution ID as defined in the POM.
> >     *
> >     * @return The execution ID.
> >     */
> >    protected String getExecutionID() {
> >
> >        String executionId = null;
> >        if (execution != null) executionId = 
> execution.getExecutionId();
> >        return executionId
> >   }
> >
> >    public abstract void execute() throws MojoExecutionException;
> > }
> >
> > Then, when I try to execute the concrete mojo, I always get the
> > following error message:
> >
> > Cause: Cannot assign configuration entry 'execution' to 'class
> > org.apache.maven.plugin.MojoExecution' from 'null', which is of type
> > class java.lang.String
> >
> > As far as I know this should work starting from Maven 2.0 (I'm using
> > version 2.2). Any idea?
> >
> > Jeff
> >
> >
> > > -----Original Message-----
> > > From: Jason van Zyl [mailto:jason@sonatype.com]
> > > Sent: Tuesday, June 15, 2010 5:14 PM
> > > To: Maven Developers List
> > > Subject: Re: How to get the execution id from a plugin
> > >
> > >
> > > Yes, I realize.
> > >
> > > Look at an existing plugin and start with that. Or use the
> > > Maven Plugin archteype. If you don't know what I'm talking
> > > about then read this:
> > >
> > > http://www.sonatype.com/products/maven/documentation/book-defguide
> > >
> > > On Jun 15, 2010, at 11:04 AM, <Gi...@b-source.ch>
> > > <Gi...@b-source.ch> wrote:
> > >
> > > > Found... but version 2.6 does not contain class
> > > MojoExecution and the
> > > > code below does not compile.
> > > >
> > > >> -----Original Message-----
> > > >> From: Jason van Zyl [mailto:jason@sonatype.com]
> > > >> Sent: Tuesday, June 15, 2010 4:51 PM
> > > >> To: Maven Developers List
> > > >> Subject: Re: How to get the execution id from a plugin
> > > >>
> > > >>
> > > >> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-p
> > > >> lugin-plugin/
> > > >>
> > > >> On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch>
> > > >> <Gi...@b-source.ch> wrote:
> > > >>
> > > >>> ... it does not compile because the central repository does
> > > >> not contain
> > > >>> artifact maven-plugin-plugin :-(
> > > >>>
> > > >>> Jeff
> > > >>>
> > > >>>> -----Original Message-----
> > > >>>> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu]
> > > >>>> Sent: Tuesday, June 15, 2010 3:49 PM
> > > >>>> To: Maven Developers List
> > > >>>> Subject: Re: How to get the execution id from a plugin
> > > >>>>
> > > >>>>
> > > >>>> Giuseppe.Greco wrote:
> > > >>>>
> > > >>>>>   private void execute() throws MojoExecutionException
> > > >>>>>   {
> > > >>>>>       /* I need to get the execution id here */
> > > >>>>>   }
> > > >>>>
> > > >>>>  /**
> > > >>>>   * @parameter default-value="${mojoExecution}"
> > > >>>>   * @readonly
> > > >>>>   */
> > > >>>>  private MojoExecution mojoExecution;
> > > >>>>
> > > >>>> and
> > > >>>>
> > > >>>>  mojoExecution.getId();
> > > >>>>
> > > >>>> should do. I only can't tell since what Maven 
> version that works.
> > > >>>>
> > > >>>>
> > > >>>> Benjamin
> > > >>>>
> > > >>>>
> > > >>
> > > 
> ---------------------------------------------------------------------
> > > >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > >>>> For additional commands, e-mail: dev-help@maven.apache.org
> > > >>>>
> > > >>>>
> > > >>>
> > > >>> IMPORTANT:
> > > >>> This e-mail transmission is intended for the named
> > > >>> addressee(s)only.
> > > >>> Its contents are private, confidential and protected
> > > >>> from disclosure and should not be read, copied or
> > > >>> disclosed by any other person.
> > > >>> If you are not the intended recipient, we kindly ask
> > > >>> you to notify the sender immediately by telephone
> > > >>> (+41 (0)58 806 50 00), to redirect the message to the
> > > >>> account "info@b-source.ch" and to delete this e-mail.
> > > >>> E-mail transmissions may be intercepted, altered or
> > > >>> read by unauthorized persons and may contain viruses.
> > > >>> Therefore, it is recommended that you use regular mail
> > > >>> or courier services for any information intended to be
> > > >>> confidential. However, by sending us messages through
> > > >>> e-mail, you authorize and instruct us to correspond by
> > > >>> e-mail in the relevant matter.
> > > >>> Thank you.
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > 
> ---------------------------------------------------------------------
> > > >>> 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
> > > >> http://twitter.com/jvanzyl
> > > >> ---------------------------------------------------------
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>
> > > >
> > > > IMPORTANT:
> > > > This e-mail transmission is intended for the named
> > > > addressee(s)only.
> > > > Its contents are private, confidential and protected
> > > > from disclosure and should not be read, copied or
> > > > disclosed by any other person.
> > > > If you are not the intended recipient, we kindly ask
> > > > you to notify the sender immediately by telephone
> > > > (+41 (0)58 806 50 00), to redirect the message to the
> > > > account "info@b-source.ch" and to delete this e-mail.
> > > > E-mail transmissions may be intercepted, altered or
> > > > read by unauthorized persons and may contain viruses.
> > > > Therefore, it is recommended that you use regular mail
> > > > or courier services for any information intended to be
> > > > confidential. However, by sending us messages through
> > > > e-mail, you authorize and instruct us to correspond by
> > > > e-mail in the relevant matter.
> > > > Thank you.
> > > >
> > > >
> > > >
> > > 
> ---------------------------------------------------------------------
> > > > 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
> > > http://twitter.com/jvanzyl
> > > ---------------------------------------------------------
> > >
> > > A language that doesn't affect the way you think about
> > > programming is not worth knowing.
> > >
> > >  -- Alan Perlis
> > >
> > >
> > >
> > >
> >
> > IMPORTANT:
> > This e-mail transmission is intended for the named
> > addressee(s)only.
> > Its contents are private, confidential and protected
> > from disclosure and should not be read, copied or
> > disclosed by any other person.
> > If you are not the intended recipient, we kindly ask
> > you to notify the sender immediately by telephone
> > (+41 (0)58 806 50 00), to redirect the message to the
> > account "info@b-source.ch" and to delete this e-mail.
> > E-mail transmissions may be intercepted, altered or
> > read by unauthorized persons and may contain viruses.
> > Therefore, it is recommended that you use regular mail
> > or courier services for any information intended to be
> > confidential. However, by sending us messages through
> > e-mail, you authorize and instruct us to correspond by
> > e-mail in the relevant matter.
> > Thank you.
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> 

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: How to get the execution id from a plugin

Posted by Stephen Connolly <st...@gmail.com>.
On 15 June 2010 16:31, <Gi...@b-source.ch> wrote:

> Finally I was able to compile it... but it does not work. I created a
> base class like this:
>
> public abstract class ContextAbstractMojo extends AbstractMojo {
>
>    /**
>     * The execution ID as defined in the POM.
>      *
>     * @parameter default-value="${mojoExecution}}"
>

you have a syntax error here, try using only one closing }


>     * @readonly
>     */
>     private MojoExecution execution;
>
>    /**
>     * The context ID as an alternative to the execution ID.
>     */
>    //private String context;
>
>    /**
>     * Gets the execution ID as defined in the POM.
>     *
>     * @return The execution ID.
>     */
>    protected String getExecutionID() {
>
>        String executionId = null;
>        if (execution != null) executionId = execution.getExecutionId();
>        return executionId
>   }
>
>    public abstract void execute() throws MojoExecutionException;
> }
>
> Then, when I try to execute the concrete mojo, I always get the
> following error message:
>
> Cause: Cannot assign configuration entry 'execution' to 'class
> org.apache.maven.plugin.MojoExecution' from 'null', which is of type
> class java.lang.String
>
> As far as I know this should work starting from Maven 2.0 (I'm using
> version 2.2). Any idea?
>
> Jeff
>
>
> > -----Original Message-----
> > From: Jason van Zyl [mailto:jason@sonatype.com]
> > Sent: Tuesday, June 15, 2010 5:14 PM
> > To: Maven Developers List
> > Subject: Re: How to get the execution id from a plugin
> >
> >
> > Yes, I realize.
> >
> > Look at an existing plugin and start with that. Or use the
> > Maven Plugin archteype. If you don't know what I'm talking
> > about then read this:
> >
> > http://www.sonatype.com/products/maven/documentation/book-defguide
> >
> > On Jun 15, 2010, at 11:04 AM, <Gi...@b-source.ch>
> > <Gi...@b-source.ch> wrote:
> >
> > > Found... but version 2.6 does not contain class
> > MojoExecution and the
> > > code below does not compile.
> > >
> > >> -----Original Message-----
> > >> From: Jason van Zyl [mailto:jason@sonatype.com]
> > >> Sent: Tuesday, June 15, 2010 4:51 PM
> > >> To: Maven Developers List
> > >> Subject: Re: How to get the execution id from a plugin
> > >>
> > >>
> > >> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-p
> > >> lugin-plugin/
> > >>
> > >> On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch>
> > >> <Gi...@b-source.ch> wrote:
> > >>
> > >>> ... it does not compile because the central repository does
> > >> not contain
> > >>> artifact maven-plugin-plugin :-(
> > >>>
> > >>> Jeff
> > >>>
> > >>>> -----Original Message-----
> > >>>> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu]
> > >>>> Sent: Tuesday, June 15, 2010 3:49 PM
> > >>>> To: Maven Developers List
> > >>>> Subject: Re: How to get the execution id from a plugin
> > >>>>
> > >>>>
> > >>>> Giuseppe.Greco wrote:
> > >>>>
> > >>>>>   private void execute() throws MojoExecutionException
> > >>>>>   {
> > >>>>>       /* I need to get the execution id here */
> > >>>>>   }
> > >>>>
> > >>>>  /**
> > >>>>   * @parameter default-value="${mojoExecution}"
> > >>>>   * @readonly
> > >>>>   */
> > >>>>  private MojoExecution mojoExecution;
> > >>>>
> > >>>> and
> > >>>>
> > >>>>  mojoExecution.getId();
> > >>>>
> > >>>> should do. I only can't tell since what Maven version that works.
> > >>>>
> > >>>>
> > >>>> Benjamin
> > >>>>
> > >>>>
> > >>
> > ---------------------------------------------------------------------
> > >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >>>> For additional commands, e-mail: dev-help@maven.apache.org
> > >>>>
> > >>>>
> > >>>
> > >>> IMPORTANT:
> > >>> This e-mail transmission is intended for the named
> > >>> addressee(s)only.
> > >>> Its contents are private, confidential and protected
> > >>> from disclosure and should not be read, copied or
> > >>> disclosed by any other person.
> > >>> If you are not the intended recipient, we kindly ask
> > >>> you to notify the sender immediately by telephone
> > >>> (+41 (0)58 806 50 00), to redirect the message to the
> > >>> account "info@b-source.ch" and to delete this e-mail.
> > >>> E-mail transmissions may be intercepted, altered or
> > >>> read by unauthorized persons and may contain viruses.
> > >>> Therefore, it is recommended that you use regular mail
> > >>> or courier services for any information intended to be
> > >>> confidential. However, by sending us messages through
> > >>> e-mail, you authorize and instruct us to correspond by
> > >>> e-mail in the relevant matter.
> > >>> Thank you.
> > >>>
> > >>>
> > >>>
> > >>
> > ---------------------------------------------------------------------
> > >>> 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
> > >> http://twitter.com/jvanzyl
> > >> ---------------------------------------------------------
> > >>
> > >>
> > >>
> > >>
> > >>
> > >
> > > IMPORTANT:
> > > This e-mail transmission is intended for the named
> > > addressee(s)only.
> > > Its contents are private, confidential and protected
> > > from disclosure and should not be read, copied or
> > > disclosed by any other person.
> > > If you are not the intended recipient, we kindly ask
> > > you to notify the sender immediately by telephone
> > > (+41 (0)58 806 50 00), to redirect the message to the
> > > account "info@b-source.ch" and to delete this e-mail.
> > > E-mail transmissions may be intercepted, altered or
> > > read by unauthorized persons and may contain viruses.
> > > Therefore, it is recommended that you use regular mail
> > > or courier services for any information intended to be
> > > confidential. However, by sending us messages through
> > > e-mail, you authorize and instruct us to correspond by
> > > e-mail in the relevant matter.
> > > Thank you.
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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
> > http://twitter.com/jvanzyl
> > ---------------------------------------------------------
> >
> > A language that doesn't affect the way you think about
> > programming is not worth knowing.
> >
> >  -- Alan Perlis
> >
> >
> >
> >
>
> IMPORTANT:
> This e-mail transmission is intended for the named
> addressee(s)only.
> Its contents are private, confidential and protected
> from disclosure and should not be read, copied or
> disclosed by any other person.
> If you are not the intended recipient, we kindly ask
> you to notify the sender immediately by telephone
> (+41 (0)58 806 50 00), to redirect the message to the
> account "info@b-source.ch" and to delete this e-mail.
> E-mail transmissions may be intercepted, altered or
> read by unauthorized persons and may contain viruses.
> Therefore, it is recommended that you use regular mail
> or courier services for any information intended to be
> confidential. However, by sending us messages through
> e-mail, you authorize and instruct us to correspond by
> e-mail in the relevant matter.
> Thank you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

RE: How to get the execution id from a plugin

Posted by Gi...@b-source.ch.
Finally I was able to compile it... but it does not work. I created a
base class like this:

public abstract class ContextAbstractMojo extends AbstractMojo {

    /**
     * The execution ID as defined in the POM.
     *
     * @parameter default-value="${mojoExecution}}"
     * @readonly
     */
    private MojoExecution execution;

    /**
     * The context ID as an alternative to the execution ID.
     */
    //private String context;

    /**
     * Gets the execution ID as defined in the POM.
     *
     * @return The execution ID.
     */
    protected String getExecutionID() {

        String executionId = null;
        if (execution != null) executionId = execution.getExecutionId();
        return executionId 
   }

    public abstract void execute() throws MojoExecutionException;
}

Then, when I try to execute the concrete mojo, I always get the
following error message:

Cause: Cannot assign configuration entry 'execution' to 'class
org.apache.maven.plugin.MojoExecution' from 'null', which is of type
class java.lang.String

As far as I know this should work starting from Maven 2.0 (I'm using
version 2.2). Any idea?

Jeff


> -----Original Message-----
> From: Jason van Zyl [mailto:jason@sonatype.com] 
> Sent: Tuesday, June 15, 2010 5:14 PM
> To: Maven Developers List
> Subject: Re: How to get the execution id from a plugin
> 
> 
> Yes, I realize. 
> 
> Look at an existing plugin and start with that. Or use the 
> Maven Plugin archteype. If you don't know what I'm talking 
> about then read this:
> 
> http://www.sonatype.com/products/maven/documentation/book-defguide
> 
> On Jun 15, 2010, at 11:04 AM, <Gi...@b-source.ch> 
> <Gi...@b-source.ch> wrote:
> 
> > Found... but version 2.6 does not contain class 
> MojoExecution and the
> > code below does not compile.
> > 
> >> -----Original Message-----
> >> From: Jason van Zyl [mailto:jason@sonatype.com] 
> >> Sent: Tuesday, June 15, 2010 4:51 PM
> >> To: Maven Developers List
> >> Subject: Re: How to get the execution id from a plugin
> >> 
> >> 
> >> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-p
> >> lugin-plugin/
> >> 
> >> On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch> 
> >> <Gi...@b-source.ch> wrote:
> >> 
> >>> ... it does not compile because the central repository does 
> >> not contain
> >>> artifact maven-plugin-plugin :-(
> >>> 
> >>> Jeff
> >>> 
> >>>> -----Original Message-----
> >>>> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
> >>>> Sent: Tuesday, June 15, 2010 3:49 PM
> >>>> To: Maven Developers List
> >>>> Subject: Re: How to get the execution id from a plugin
> >>>> 
> >>>> 
> >>>> Giuseppe.Greco wrote:
> >>>> 
> >>>>>   private void execute() throws MojoExecutionException
> >>>>>   {
> >>>>>       /* I need to get the execution id here */
> >>>>>   }
> >>>> 
> >>>>  /**
> >>>>   * @parameter default-value="${mojoExecution}"
> >>>>   * @readonly
> >>>>   */
> >>>>  private MojoExecution mojoExecution;
> >>>> 
> >>>> and
> >>>> 
> >>>>  mojoExecution.getId();
> >>>> 
> >>>> should do. I only can't tell since what Maven version that works.
> >>>> 
> >>>> 
> >>>> Benjamin
> >>>> 
> >>>> 
> >> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>> 
> >>>> 
> >>> 
> >>> IMPORTANT:
> >>> This e-mail transmission is intended for the named
> >>> addressee(s)only.
> >>> Its contents are private, confidential and protected
> >>> from disclosure and should not be read, copied or
> >>> disclosed by any other person.
> >>> If you are not the intended recipient, we kindly ask
> >>> you to notify the sender immediately by telephone
> >>> (+41 (0)58 806 50 00), to redirect the message to the
> >>> account "info@b-source.ch" and to delete this e-mail.
> >>> E-mail transmissions may be intercepted, altered or
> >>> read by unauthorized persons and may contain viruses.
> >>> Therefore, it is recommended that you use regular mail
> >>> or courier services for any information intended to be
> >>> confidential. However, by sending us messages through
> >>> e-mail, you authorize and instruct us to correspond by
> >>> e-mail in the relevant matter.
> >>> Thank you.
> >>> 
> >>> 
> >>> 
> >> 
> ---------------------------------------------------------------------
> >>> 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
> >> http://twitter.com/jvanzyl
> >> ---------------------------------------------------------
> >> 
> >> 
> >> 
> >> 
> >> 
> > 
> > IMPORTANT:
> > This e-mail transmission is intended for the named
> > addressee(s)only.
> > Its contents are private, confidential and protected
> > from disclosure and should not be read, copied or
> > disclosed by any other person.
> > If you are not the intended recipient, we kindly ask
> > you to notify the sender immediately by telephone
> > (+41 (0)58 806 50 00), to redirect the message to the
> > account "info@b-source.ch" and to delete this e-mail.
> > E-mail transmissions may be intercepted, altered or
> > read by unauthorized persons and may contain viruses.
> > Therefore, it is recommended that you use regular mail
> > or courier services for any information intended to be
> > confidential. However, by sending us messages through
> > e-mail, you authorize and instruct us to correspond by
> > e-mail in the relevant matter.
> > Thank you.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> http://twitter.com/jvanzyl
> ---------------------------------------------------------
> 
> A language that doesn't affect the way you think about 
> programming is not worth knowing. 
>  
>  -- Alan Perlis
> 
> 
> 
> 

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: How to get the execution id from a plugin

Posted by Jason van Zyl <ja...@sonatype.com>.
Yes, I realize. 

Look at an existing plugin and start with that. Or use the Maven Plugin archteype. If you don't know what I'm talking about then read this:

http://www.sonatype.com/products/maven/documentation/book-defguide

On Jun 15, 2010, at 11:04 AM, <Gi...@b-source.ch> <Gi...@b-source.ch> wrote:

> Found... but version 2.6 does not contain class MojoExecution and the
> code below does not compile.
> 
>> -----Original Message-----
>> From: Jason van Zyl [mailto:jason@sonatype.com] 
>> Sent: Tuesday, June 15, 2010 4:51 PM
>> To: Maven Developers List
>> Subject: Re: How to get the execution id from a plugin
>> 
>> 
>> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-p
>> lugin-plugin/
>> 
>> On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch> 
>> <Gi...@b-source.ch> wrote:
>> 
>>> ... it does not compile because the central repository does 
>> not contain
>>> artifact maven-plugin-plugin :-(
>>> 
>>> Jeff
>>> 
>>>> -----Original Message-----
>>>> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
>>>> Sent: Tuesday, June 15, 2010 3:49 PM
>>>> To: Maven Developers List
>>>> Subject: Re: How to get the execution id from a plugin
>>>> 
>>>> 
>>>> Giuseppe.Greco wrote:
>>>> 
>>>>>   private void execute() throws MojoExecutionException
>>>>>   {
>>>>>       /* I need to get the execution id here */
>>>>>   }
>>>> 
>>>>  /**
>>>>   * @parameter default-value="${mojoExecution}"
>>>>   * @readonly
>>>>   */
>>>>  private MojoExecution mojoExecution;
>>>> 
>>>> and
>>>> 
>>>>  mojoExecution.getId();
>>>> 
>>>> should do. I only can't tell since what Maven version that works.
>>>> 
>>>> 
>>>> Benjamin
>>>> 
>>>> 
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>> 
>>>> 
>>> 
>>> IMPORTANT:
>>> This e-mail transmission is intended for the named
>>> addressee(s)only.
>>> Its contents are private, confidential and protected
>>> from disclosure and should not be read, copied or
>>> disclosed by any other person.
>>> If you are not the intended recipient, we kindly ask
>>> you to notify the sender immediately by telephone
>>> (+41 (0)58 806 50 00), to redirect the message to the
>>> account "info@b-source.ch" and to delete this e-mail.
>>> E-mail transmissions may be intercepted, altered or
>>> read by unauthorized persons and may contain viruses.
>>> Therefore, it is recommended that you use regular mail
>>> or courier services for any information intended to be
>>> confidential. However, by sending us messages through
>>> e-mail, you authorize and instruct us to correspond by
>>> e-mail in the relevant matter.
>>> Thank you.
>>> 
>>> 
>>> 
>> ---------------------------------------------------------------------
>>> 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
>> http://twitter.com/jvanzyl
>> ---------------------------------------------------------
>> 
>> 
>> 
>> 
>> 
> 
> IMPORTANT:
> This e-mail transmission is intended for the named
> addressee(s)only.
> Its contents are private, confidential and protected
> from disclosure and should not be read, copied or
> disclosed by any other person.
> If you are not the intended recipient, we kindly ask
> you to notify the sender immediately by telephone
> (+41 (0)58 806 50 00), to redirect the message to the
> account "info@b-source.ch" and to delete this e-mail.
> E-mail transmissions may be intercepted, altered or
> read by unauthorized persons and may contain viruses.
> Therefore, it is recommended that you use regular mail
> or courier services for any information intended to be
> confidential. However, by sending us messages through
> e-mail, you authorize and instruct us to correspond by
> e-mail in the relevant matter.
> Thank you.
> 
> 
> ---------------------------------------------------------------------
> 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
http://twitter.com/jvanzyl
---------------------------------------------------------

A language that doesn’t affect the way you think about programming is not worth knowing. 
 
 -— Alan Perlis




Re: How to get the execution id from a plugin

Posted by Benjamin Bentmann <be...@udo.edu>.
Giuseppe.Greco wrote:

> Found... but version 2.6 does not contain class MojoExecution and the
> code below does not compile.

I don't really understand what you're trying to do when you *depend* on 
the maven-plugin-plugin, usually it's just used to built your plugin's 
metadata.

MojoExecution is part of maven-core-X.jar


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: How to get the execution id from a plugin

Posted by Gi...@b-source.ch.
Found... but version 2.6 does not contain class MojoExecution and the
code below does not compile.

> -----Original Message-----
> From: Jason van Zyl [mailto:jason@sonatype.com] 
> Sent: Tuesday, June 15, 2010 4:51 PM
> To: Maven Developers List
> Subject: Re: How to get the execution id from a plugin
> 
> 
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-p
> lugin-plugin/
> 
> On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch> 
> <Gi...@b-source.ch> wrote:
> 
> > ... it does not compile because the central repository does 
> not contain
> > artifact maven-plugin-plugin :-(
> > 
> > Jeff
> > 
> >> -----Original Message-----
> >> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
> >> Sent: Tuesday, June 15, 2010 3:49 PM
> >> To: Maven Developers List
> >> Subject: Re: How to get the execution id from a plugin
> >> 
> >> 
> >> Giuseppe.Greco wrote:
> >> 
> >>>    private void execute() throws MojoExecutionException
> >>>    {
> >>>        /* I need to get the execution id here */
> >>>    }
> >> 
> >>   /**
> >>    * @parameter default-value="${mojoExecution}"
> >>    * @readonly
> >>    */
> >>   private MojoExecution mojoExecution;
> >> 
> >> and
> >> 
> >>   mojoExecution.getId();
> >> 
> >> should do. I only can't tell since what Maven version that works.
> >> 
> >> 
> >> Benjamin
> >> 
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >> 
> >> 
> > 
> > IMPORTANT:
> > This e-mail transmission is intended for the named
> > addressee(s)only.
> > Its contents are private, confidential and protected
> > from disclosure and should not be read, copied or
> > disclosed by any other person.
> > If you are not the intended recipient, we kindly ask
> > you to notify the sender immediately by telephone
> > (+41 (0)58 806 50 00), to redirect the message to the
> > account "info@b-source.ch" and to delete this e-mail.
> > E-mail transmissions may be intercepted, altered or
> > read by unauthorized persons and may contain viruses.
> > Therefore, it is recommended that you use regular mail
> > or courier services for any information intended to be
> > confidential. However, by sending us messages through
> > e-mail, you authorize and instruct us to correspond by
> > e-mail in the relevant matter.
> > Thank you.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> http://twitter.com/jvanzyl
> ---------------------------------------------------------
> 
> 
> 
> 
> 

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: How to get the execution id from a plugin

Posted by Jason van Zyl <ja...@sonatype.com>.
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin-plugin/

On Jun 15, 2010, at 10:49 AM, <Gi...@b-source.ch> <Gi...@b-source.ch> wrote:

> ... it does not compile because the central repository does not contain
> artifact maven-plugin-plugin :-(
> 
> Jeff
> 
>> -----Original Message-----
>> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
>> Sent: Tuesday, June 15, 2010 3:49 PM
>> To: Maven Developers List
>> Subject: Re: How to get the execution id from a plugin
>> 
>> 
>> Giuseppe.Greco wrote:
>> 
>>>    private void execute() throws MojoExecutionException
>>>    {
>>>        /* I need to get the execution id here */
>>>    }
>> 
>>   /**
>>    * @parameter default-value="${mojoExecution}"
>>    * @readonly
>>    */
>>   private MojoExecution mojoExecution;
>> 
>> and
>> 
>>   mojoExecution.getId();
>> 
>> should do. I only can't tell since what Maven version that works.
>> 
>> 
>> Benjamin
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 
> 
> IMPORTANT:
> This e-mail transmission is intended for the named
> addressee(s)only.
> Its contents are private, confidential and protected
> from disclosure and should not be read, copied or
> disclosed by any other person.
> If you are not the intended recipient, we kindly ask
> you to notify the sender immediately by telephone
> (+41 (0)58 806 50 00), to redirect the message to the
> account "info@b-source.ch" and to delete this e-mail.
> E-mail transmissions may be intercepted, altered or
> read by unauthorized persons and may contain viruses.
> Therefore, it is recommended that you use regular mail
> or courier services for any information intended to be
> confidential. However, by sending us messages through
> e-mail, you authorize and instruct us to correspond by
> e-mail in the relevant matter.
> Thank you.
> 
> 
> ---------------------------------------------------------------------
> 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
http://twitter.com/jvanzyl
---------------------------------------------------------





RE: How to get the execution id from a plugin

Posted by Gi...@b-source.ch.
... it does not compile because the central repository does not contain
artifact maven-plugin-plugin :-(

Jeff

> -----Original Message-----
> From: Benjamin Bentmann [mailto:benjamin.bentmann@udo.edu] 
> Sent: Tuesday, June 15, 2010 3:49 PM
> To: Maven Developers List
> Subject: Re: How to get the execution id from a plugin
> 
> 
> Giuseppe.Greco wrote:
> 
> >     private void execute() throws MojoExecutionException
> >     {
> >         /* I need to get the execution id here */
> >     }
> 
>    /**
>     * @parameter default-value="${mojoExecution}"
>     * @readonly
>     */
>    private MojoExecution mojoExecution;
> 
> and
> 
>    mojoExecution.getId();
> 
> should do. I only can't tell since what Maven version that works.
> 
> 
> Benjamin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: How to get the execution id from a plugin

Posted by Benjamin Bentmann <be...@udo.edu>.
Giuseppe.Greco wrote:

>     private void execute() throws MojoExecutionException
>     {
>         /* I need to get the execution id here */
>     }

   /**
    * @parameter default-value="${mojoExecution}"
    * @readonly
    */
   private MojoExecution mojoExecution;

and

   mojoExecution.getId();

should do. I only can't tell since what Maven version that works.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org