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/08/31 06:11:55 UTC

Decorating Mojos

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

Re: Decorating Mojos

Posted by Jason van Zyl <ja...@takari.io>.
William,

If you just want to know what Mojos are being used then there are a couple implementations for profiling[1][2] but they use EventSpies which means they have to be installed in the distribution being used in order to be activated. We had a brief discussion a few months ago about making an eventing mechanism that didn't require being in the distribution. Take a look and see if what these profilers are doing is along the lines of what you want and then maybe it's another discussion item for the developer hangout.

It may also not be hard to make event spies work as extensions configured in the POM (IIRC they do not right now). If you want to see which of your plugins are popular the Nexus OSS instance has stats that you can extract and analyze yourself. The download counts will give you some idea.

[1]: https://github.com/takari/maven-profiler
[2]: https://github.com/eBay/mTracker

On Aug 31, 2014, at 12:11 AM, William Ferguson <wi...@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
---------------------------------------------------------

What matters is not ideas, but the people who have them. Good people can fix bad ideas, but good ideas can't save bad people. 

 -- Paul Graham










Re: Decorating Mojos

Posted by William Ferguson <wi...@xandar.com.au>.
Glad you chipped in Manfred :-)

I was mainly thinking about this for the the android-maven-plugin as it has
a huge number of Mojos, many of which I suspect are hardly ever used.
getting some quantification on usage would allow us to work out which Mojos
could be dropped and which might be better to push into a separate plugin.

People might object, but if we default to on and give an option to switch
off, that seems fair for use of an open source plugin. And analytics
collection is only going to work when you have a connection.

William


On Tue, Sep 2, 2014 at 4:46 AM, Manfred Moser <ma...@mosabuam.com> wrote:

> If you want this to be resulting in some sort of useful analysis results I
> would think it should be fairly useful to hook it up as an option for the
> plugin and use e.g. Google analytics with some fake urls for each mojo.
>
> Only problem is that people might object to you doing that..
>
> manfred
>
> Jason van Zyl wrote on 31.08.2014 05:47:
>
> > 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
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Decorating Mojos

Posted by Manfred Moser <ma...@mosabuam.com>.
If you want this to be resulting in some sort of useful analysis results I would think it should be fairly useful to hook it up as an option for the plugin and use e.g. Google analytics with some fake urls for each mojo.

Only problem is that people might object to you doing that.. 

manfred

Jason van Zyl wrote on 31.08.2014 05:47:

> 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 <wi...@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
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


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


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










Re: Decorating Mojos

Posted by William Ferguson <wi...@xandar.com.au>.
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>.
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 <wi...@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 Robert Scholte <rf...@apache.org>.
Hi William,

I would probably start with aspects.
These are post-processors, so you need to run them as part of your build  
lifecycle.
See http://mojo.codehaus.org/aspectj-maven-plugin/ how to use aspectj.
I think we can think of a runtime solution as well, but that would be much  
more complicated.

thanks,
Robert

Op Sun, 31 Aug 2014 06:11:55 +0200 schreef William Ferguson  
<wi...@xandar.com.au>:

> 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

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