You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Hervé BOUTEMY <he...@free.fr> on 2011/11/04 00:18:08 UTC

[PROPOSAL] Java 5 Annotations for Plugins

Hi,

I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]

Before going deeper into code, I'd like to have some review of the proposed 
form of the tool. Any comment is welcome.

Regards,

Hervé


[1] 
https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins

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


Re: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Jason van Zyl <ja...@tesla.io>.
There is code here which I will propose as a candidate of part of what I call Tesla. I hope that this can be integrated into Maven:

https://github.com/etesla/tesla-plugin-api

On Nov 7, 2011, at 10:30 AM, Jesse Glick wrote:

> On 11/04/2011 07:13 AM, Stephen Connolly wrote:
>> you generate a class that extends
>> AbstractMojo, has the required injection fields for all the
>> @parameters and has an execute method that passes through all the
>> injection fields and then invokes the required method.
> 
> By the way this (as well as HelpMojo generation) could be done rather easily without ASM or any special goals in maven-plugin-plugin if you compile under Java 6: an annotation processor can generate Java sources which will also get compiled, as well as creating/updating META-INF/maven/plugin.xml. But I guess we cannot rely on this yet.
> 
> I do not think Phase should be an enum, just a list of String constants - you are permitted to define alternative lifecycles, right?
> 
> 
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------

We know what we are, but know not what we may be.

  -- Shakespeare





Re: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Jesse Glick <je...@oracle.com>.
On 11/04/2011 07:13 AM, Stephen Connolly wrote:
> you generate a class that extends
> AbstractMojo, has the required injection fields for all the
> @parameters and has an execute method that passes through all the
> injection fields and then invokes the required method.

By the way this (as well as HelpMojo generation) could be done rather easily without ASM or any special goals in maven-plugin-plugin if you compile under Java 6: an 
annotation processor can generate Java sources which will also get compiled, as well as creating/updating META-INF/maven/plugin.xml. But I guess we cannot rely on this yet.

I do not think Phase should be an enum, just a list of String constants - you are permitted to define alternative lifecycles, right?


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


Re: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Stephen Connolly <st...@gmail.com>.
to clarify what I mean, you generate a class that extends
AbstractMojo, has the required injection fields for all the
@parameters and has an execute method that passes through all the
injection fields and then invokes the required method.

On 4 November 2011 11:11, Stephen Connolly
<st...@gmail.com> wrote:
> Syntetic bridging classes solves that issue and keeps 2.2.1 compat (as
> 2.0.x is JDK 1.4)
>
> On 4 November 2011 11:09, Olivier Lamy <ol...@apache.org> wrote:
>> Hello,
>>
>> Things like below will need some changes in core, IMHO we need to be
>> compliant with core 2.x and 3.x :
>>
>>  @Goal(name="foo")
>>  public void doExecuteGoal() {
>>    // equiv of AbstractMojo.execute without requiring the interface
>>  }
>>
>>  @Goal(name="bar")
>>  public void doOtherExecuteGoal() {
>>    // allowing multiple goals from the same shared common class
>>  }
>>
>>
>>
>> 2011/11/4 Stephen Connolly <st...@gmail.com>:
>>> added a comment
>>>
>>> On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
>>>> Hi,
>>>>
>>>> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>>>>
>>>> Before going deeper into code, I'd like to have some review of the proposed
>>>> form of the tool. Any comment is welcome.
>>>>
>>>> Regards,
>>>>
>>>> Hervé
>>>>
>>>>
>>>> [1]
>>>> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>
>>
>>
>> --
>> Olivier Lamy
>> Talend : http://talend.com
>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>>
>> ---------------------------------------------------------------------
>> 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: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Stephen Connolly <st...@gmail.com>.
Syntetic bridging classes solves that issue and keeps 2.2.1 compat (as
2.0.x is JDK 1.4)

On 4 November 2011 11:09, Olivier Lamy <ol...@apache.org> wrote:
> Hello,
>
> Things like below will need some changes in core, IMHO we need to be
> compliant with core 2.x and 3.x :
>
>  @Goal(name="foo")
>  public void doExecuteGoal() {
>    // equiv of AbstractMojo.execute without requiring the interface
>  }
>
>  @Goal(name="bar")
>  public void doOtherExecuteGoal() {
>    // allowing multiple goals from the same shared common class
>  }
>
>
>
> 2011/11/4 Stephen Connolly <st...@gmail.com>:
>> added a comment
>>
>> On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
>>> Hi,
>>>
>>> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>>>
>>> Before going deeper into code, I'd like to have some review of the proposed
>>> form of the tool. Any comment is welcome.
>>>
>>> Regards,
>>>
>>> Hervé
>>>
>>>
>>> [1]
>>> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
>
>
> --
> Olivier Lamy
> Talend : http://talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> 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: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Olivier Lamy <ol...@apache.org>.
Hello,

Things like below will need some changes in core, IMHO we need to be
compliant with core 2.x and 3.x :

  @Goal(name="foo")
  public void doExecuteGoal() {
    // equiv of AbstractMojo.execute without requiring the interface
  }

  @Goal(name="bar")
  public void doOtherExecuteGoal() {
    // allowing multiple goals from the same shared common class
  }



2011/11/4 Stephen Connolly <st...@gmail.com>:
> added a comment
>
> On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
>> Hi,
>>
>> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>>
>> Before going deeper into code, I'd like to have some review of the proposed
>> form of the tool. Any comment is welcome.
>>
>> Regards,
>>
>> Hervé
>>
>>
>> [1]
>> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
Olivier Lamy
Talend : http://talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Mark Derricutt <ma...@talios.com>.
+3

( why does every only +1 on these things - this aint Google folks! ).

Love the last example with multiple @Goal annotations on methods.
-- 
"Great artists are extremely selfish and arrogant things" — Steven Wilson,
Porcupine Tree


On Fri, Nov 4, 2011 at 11:49 PM, Simone Tripodi <si...@apache.org>wrote:

> +1 to Stephen's comment, that looks even better!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
>
>
> On Fri, Nov 4, 2011 at 11:09 AM, Stephen Connolly
> <st...@gmail.com> wrote:
> > added a comment
> >
> > On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
> >> Hi,
> >>
> >> I reworked on Java 5 Annotations for Plugins proposal started a while
> ago: [1]
> >>
> >> Before going deeper into code, I'd like to have some review of the
> proposed
> >> form of the tool. Any comment is welcome.
> >>
> >> Regards,
> >>
> >> Hervé
> >>
> >>
> >> [1]
> >>
> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
> >>
> >> ---------------------------------------------------------------------
> >> 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: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Simone Tripodi <si...@apache.org>.
+1 to Stephen's comment, that looks even better!
Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Fri, Nov 4, 2011 at 11:09 AM, Stephen Connolly
<st...@gmail.com> wrote:
> added a comment
>
> On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
>> Hi,
>>
>> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>>
>> Before going deeper into code, I'd like to have some review of the proposed
>> form of the tool. Any comment is welcome.
>>
>> Regards,
>>
>> Hervé
>>
>>
>> [1]
>> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>>
>> ---------------------------------------------------------------------
>> 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: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Stephen Connolly <st...@gmail.com>.
added a comment

On 3 November 2011 23:18, Hervé BOUTEMY <he...@free.fr> wrote:
> Hi,
>
> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>
> Before going deeper into code, I'd like to have some review of the proposed
> form of the tool. Any comment is welcome.
>
> Regards,
>
> Hervé
>
>
> [1]
> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>
> ---------------------------------------------------------------------
> 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: [PROPOSAL] Java 5 Annotations for Plugins

Posted by Simone Tripodi <si...@apache.org>.
Salut Hervé!
I developed a Maven plugin only once[1] but I would loved to use those
annotations instead of Javadoc.
The benefits I would have got are exactly the ones you described in
the Wiki - IMHO this work has to be part of a required innovation in
therms of simplification of plugin development.
As user, I wouldn't take in consideration at all the Javadoc approach,
when Annotations are available.
My *non-binding* +1 on proceeding to it! (and hope to find spare time
to contribute :P)
Have  anice day, all the best!
Simo

[1] http://s.apache.org/0b

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Fri, Nov 4, 2011 at 12:18 AM, Hervé BOUTEMY <he...@free.fr> wrote:
> Hi,
>
> I reworked on Java 5 Annotations for Plugins proposal started a while ago: [1]
>
> Before going deeper into code, I'd like to have some review of the proposed
> form of the tool. Any comment is welcome.
>
> Regards,
>
> Hervé
>
>
> [1]
> https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins
>
> ---------------------------------------------------------------------
> 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