You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by William Ferguson <wi...@xandar.com.au> on 2014/09/01 03:38:13 UTC

Re: Decorating Mojos

Thanks Guys,

Jason, I think the maven-timeline solution will be perfect.

William


On Sun, Aug 31, 2014 at 10:47 PM, Jason van Zyl <ja...@takari.io> wrote:

> Like I said it was a bit of a mess. There is also the technique used in
> the maven-timeline-plugin where you can use an execution listener:
>
>
> https://github.com/dgageot/maven-timeline/blob/master/src/main/java/net/gageot/maven/buildevents/BuildEventListener.java
>
> This can be loaded from the POM.
>
> On Aug 31, 2014, at 12:11 AM, William Ferguson <
> william.ferguson@xandar.com.au> wrote:
>
> > If I wanted to decorate the calls to each of the Mojos in a plugin what
> > would be the best way of achieving that?
> >
> > I'm considering a use case to use analytics to capture plugin usage so we
> > have a better understanding of which Mojos are of most value. And perhaps
> > to capture details on Mojo failures.
> >
> >
> > William
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
>
> I never make the mistake of arguing with people for whose opinions I have
> no respect.
>
> -- Edward Gibbon
>
>
>
>
>
>
>
>
>
>

Re: Decorating Mojos

Posted by Jason van Zyl <ja...@takari.io>.
Just to wrap this discussion up. The spies can be extended for additional events in the future and currently can handle a few more event types, but you must alter the distribution as they are not injected correctly but that can likely be fixed and was an oversight. Spies are also meant for distribution wide use the original use case being integration into Hudson (where they are still used). The execution listener has a more concrete interface (less event bus like) but I think it's easier to understand and these can be used as build extensions. These two mechanisms are very similar and likely should be combined into one mechanism. Personally I don't think we're going to need infinite extensibility and the route of the execution listener is likely a simpler and better one. The single mechanism should work as a distribution wide mechanism or a build specific mechanism. Maybe not the highest of priorities but I see a pretty even split between the use of these two mechanisms and we're just making life more complicated for ourselves.

To clean this up would be a medium complexity task if someone wanted to try and clean it up.

On Aug 31, 2014, at 9:38 PM, William Ferguson <wi...@xandar.com.au> wrote:

> Thanks Guys,
> 
> Jason, I think the maven-timeline solution will be perfect.
> 
> William
> 
> 
> On Sun, Aug 31, 2014 at 10:47 PM, Jason van Zyl <ja...@takari.io> wrote:
> 
>> Like I said it was a bit of a mess. There is also the technique used in
>> the maven-timeline-plugin where you can use an execution listener:
>> 
>> 
>> https://github.com/dgageot/maven-timeline/blob/master/src/main/java/net/gageot/maven/buildevents/BuildEventListener.java
>> 
>> This can be loaded from the POM.
>> 
>> On Aug 31, 2014, at 12:11 AM, William Ferguson <
>> william.ferguson@xandar.com.au> wrote:
>> 
>>> If I wanted to decorate the calls to each of the Mojos in a plugin what
>>> would be the best way of achieving that?
>>> 
>>> I'm considering a use case to use analytics to capture plugin usage so we
>>> have a better understanding of which Mojos are of most value. And perhaps
>>> to capture details on Mojo failures.
>>> 
>>> 
>>> William
>> 
>> Thanks,
>> 
>> Jason
>> 
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> http://twitter.com/takari_io
>> ---------------------------------------------------------
>> 
>> I never make the mistake of arguing with people for whose opinions I have
>> no respect.
>> 
>> -- Edward Gibbon
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

You are never dedicated to something you have complete confidence in.
No one is fanatically shouting that the sun is going to rise tomorrow.
They know it is going to rise tomorrow. When people are fanatically
dedicated to political or religious faiths or any other kind of 
dogmas or goals, it's always because these dogmas or
goals are in doubt.

  -- Robert Pirzig, Zen and the Art of Motorcycle Maintenance