You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Baruch Sadogursky <jb...@sadogursky.com> on 2010/08/06 00:44:50 UTC

Running mojo programmatically without build

Hi, folks!

I am trying to run some mojo without executing the whole build.
In general here's what I do:
1. Build PluginDescriptor from META-INF/maven/plugin.xml
2. Build MavenSession
3. Add Mojo instance to Plexus
4. BuildPluginManager.executeMojo()

For some reason the parameters in Mojo aren't populated with defalt values
and/or expressions (although the MojoDescriptor contains all the
parameters).

Versions:
Plexus container 1.5.4
BuildPluginManager, MavenPluginManager and MavenSession are from maven-core
3.0-beta-1
Mojo and Plugin Descriptors are from maven-plugin-api 3.0-beta-1

Any suggestions will be greatly appreciated.
Thanks in advance.
-- 
Best Regards,
Baruch

Re: Running mojo programmatically without build

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
You can have a look how it works here :
https://svn.apache.org/repos/asf/maven/plugins/branches/maven-site-plugin-3.x/


2010/8/6 Baruch Sadogursky <jb...@sadogursky.com>:
> Hi, folks!
>
> I am trying to run some mojo without executing the whole build.
> In general here's what I do:
> 1. Build PluginDescriptor from META-INF/maven/plugin.xml
> 2. Build MavenSession
> 3. Add Mojo instance to Plexus
> 4. BuildPluginManager.executeMojo()
>
> For some reason the parameters in Mojo aren't populated with defalt values
> and/or expressions (although the MojoDescriptor contains all the
> parameters).
>
> Versions:
> Plexus container 1.5.4
> BuildPluginManager, MavenPluginManager and MavenSession are from maven-core
> 3.0-beta-1
> Mojo and Plugin Descriptors are from maven-plugin-api 3.0-beta-1
>
> Any suggestions will be greatly appreciated.
> Thanks in advance.
> --
> Best Regards,
> Baruch
>



-- 
Olivier
http://twitter.com/olamy
http://fr.linkedin.com/in/olamy
http://www.viadeo.com/fr/profile/olivier.lamy7

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