maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maczka Michal <michal.mac...@imtf.ch>
Subject RE: [M2] Plugins vs Mojo vs Plexus components?
Date Wed, 13 Apr 2005 10:09:58 GMT


> -----Original Message-----
> From: Brett Porter [mailto:brett@apache.org]
> Sent: Wednesday, April 13, 2005 12:30 AM
> To: Maven Developers List
> Subject: Re: [M2] Plugins vs Mojo vs Plexus components?
> 
> 
> This is really a name confusion. The plexus things being used, for the
> most part, just being used as additional libraries, as is
> maven-archiver. eg plexus-compiler, plexus-archiver. Mojos 
> are goals or
> tasks within a plugin.
> 
> The only time plexus the container comes into it is when you see an
> expression like "#component.org.codehaus.modello.ModelloCore". This
> tells Maven to populate the variable with an instance of the given
> component from the container. However, if you are using it outside
> Maven, that's fine - you just need to pass in your own 
> instance of that,
> which can be constructed as a normal bean in most cases and configured
> manually.
> 
> What's probably missing for use outside of Maven is getters 
> and setters :)
> 
> We are currently working on the external Mojo API, so feel 
> free to mail
> any more comments about it.
> 
> Cheers,
> Brett
> 

If I can suggest something it would be nice to move more logic which deals
with mojo configuration from maven to plexus
as at the moment this logic is bit duplicated.

Mojos can be really plexus components with "per-lookup" lifestyle. 

What you will ideally have in plexus is the lookup method which takes four
parameters: role, role-hint, version and configuration
So you can lookup mojos by their ids and versions and request to inject
given configuration settings into requested components.

So the plexus API can look like follows:

lookup( Mojo.ROLE, "compiler", "1.2", myConfiguration );

With exception for versioning it is all already implemented in plexus and
just needs to be exposed.

Other thing which will be nice to have are common services which you can
configure and which are shared by multiple mojos.
For example "compile", "test", "clover" mojos they all need to use java
compiler service. 
(If I under how clover works) Clover even needs to use it twice to
instrument/compile java and test sources (and possibly generated sources), 
and needs to invoke test runner (e.g. junit, surefire, testng) which is used
in the project.
So now the question is: how it can be done?
IMO it will be nice (or even necessary) to have a possibility of configuring
some common services (like java compile, testruuner) once and only once.



michal 


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


Mime
View raw message