Re: Maven3 RC1: Executing MojoExecutions with PluginManager

2010-09-19 Thread Steffen Grunwald
On Fri, Sep 17, 2010 at 7:35 PM, Olivier Lamy ol...@apache.org wrote:
 You can have a look at the site plugin 3.x branch [1] to understand
 how to do it.

Hi Olivier, thanks for the pointer.

I've done 2 things different in my maven 2 version and I adjusted it
according to your Mojo:
- I used the PluginManager to execute. New options are
BuildPluginManager or LifecycleExecutor, which uses forking. Since I
do not understand the way I can execute the mojoExecutions forked, I
use BuildPluginManager which does the trick. Or do you suggest to use
forking? I'm asking because, if that is the right way: why isn't the
PluginManager delegating to BuildPluginManager.executeMojo() instead
of throwing UnsupportedOperationException?
- I directly passed MojoDescriptor and Plugin Execution Configuration
to the MojoExecution. You additionally converted and merged their
plexusConfiguration. Can't that be done internally by the
BuildPluginManager for less regression?

Thanks, Steffen

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Maven3 RC1: Executing MojoExecutions with PluginManager

2010-09-17 Thread Steffen
Hello,

I developed a mojo that can be used to execute executions by id with
their individual configuration.
This is needed to execute plugins seperately if they are configured
twice (i.e. the sql execute plugin) in a project.

With maven 3 this is now broken because of an
UnsupportedOperationException of the deprecated PluginManager.

Here's what I do:
- I run maven in a project, passing the execution ids to my mojo
- the mojo is checking the project's plugins for their configured executions
- If the plugin has an execution configured I want to execute: I
retrieve the plugin descriptor using the PluginManager
(verifyPlugin()) and the Configuration from the Execution and create a
MojoExecution
- I execute the MojoExecution(s) with the PluginManager
(executeMojo()). And BAAM! this is throwing the
UnsupportedOperationException

Is there a way introduced by Maven3 to execute executions by id (so I
can get rid of my own plugin)?
Is there an alternative way to execute the MojoExecution? I tried
BuildPluginManager but this just won't do either.

Thanks, Steffen

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven3 RC1: Executing MojoExecutions with PluginManager

2010-09-17 Thread Olivier Lamy
Hi,
You can have a look at the site plugin 3.x branch [1] to understand
how to do it.
In the class DefaultMavenReportExecutor.java, you will see how to
setup/prepare a mojo.

[1] 
http://svn.apache.org/repos/asf/maven/plugins/branches/maven-site-plugin-3.x/

2010/9/17 Steffen steffen.grunwald+so...@gmail.com:
 Hello,

 I developed a mojo that can be used to execute executions by id with
 their individual configuration.
 This is needed to execute plugins seperately if they are configured
 twice (i.e. the sql execute plugin) in a project.

 With maven 3 this is now broken because of an
 UnsupportedOperationException of the deprecated PluginManager.

 Here's what I do:
 - I run maven in a project, passing the execution ids to my mojo
 - the mojo is checking the project's plugins for their configured executions
 - If the plugin has an execution configured I want to execute: I
 retrieve the plugin descriptor using the PluginManager
 (verifyPlugin()) and the Configuration from the Execution and create a
 MojoExecution
 - I execute the MojoExecution(s) with the PluginManager
 (executeMojo()). And BAAM! this is throwing the
 UnsupportedOperationException

 Is there a way introduced by Maven3 to execute executions by id (so I
 can get rid of my own plugin)?
 Is there an alternative way to execute the MojoExecution? I tried
 BuildPluginManager but this just won't do either.

 Thanks, Steffen

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org





-- 
Olivier
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org