Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Another lifecycle-ish feature

FYI, we finished new lifecycle mapping implementation, barring minor
changes, like package and class name polishing ;-)

It is now possible to activate project configurator based on mojo
executions bound to clean, default and site lifecycles (used to be
default only).

There are two ways to access mojo executions from project configurators
now. AbstractProjectConfigurator#getMojoExecutions returns list of mojo
executions the configurator is enabled for in mapping metadata.
IMavenProjectFacade #getMojoExecution and #getMojoExecutions can be used
to retrieve any mojo execution bound to any project' lifecycle.

As before, AbstractProjectConfigurator#getParameterValue is the
recommended way to individual mojo execution configuration parameters.

Do note that getMojoExecution(s) methods only return mojo executions
actually bound to one of project's build lifecycles. They do NOT return
plugins only mentioned in build/pluginManagement section. You'll have to
traverse maven Model in your code, check [1] and
#getEmbeddedMetadataSource in particular, for some examples how to do this.

It is also NOT possible to activate project configurators based on
plugins only mentioned in build/pluginManagement section. In your
particular case, you should be able to activate your project
configurator based on site:site plugin execution, which is expected to
work now.

Please let us know if these changes address your needs or something is
still missing.

[1] http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java

--
Regards,
Igor

On 11-01-25 06:01 PM, Benson Margulies wrote:
On Tue, Jan 25, 2011 at 5:56 PM, Igor Fedorenko<igor@xxxxxxxxxxxxxx>  wrote:
Short answer, no plans to provide direct support for this in m2e 1.0

I'm not surprised here, I get it.


Longer answer, you probably need to look inside site:site configuration,
find out what reporting plugins are configured, then look inside
<pluginManagement/>  to find reporting plugins' configuration.

And once the 'resolve the config' API is available, that's not going
to be terribly difficult.


We still need to figure out how m2e is going to activate your project
configurator. One possibility is to allow mapping goals from site and
clean lifecycles to trigger activation of project configurators. I think
this should be relatively straightforward change, but I am not sure
about performance implications.

That makes sense.


Any ideas and suggestions are welcome.

--
Regards,
Igor

On 11-01-25 05:44 PM, Benson Margulies wrote:

In M3,<reporting/>    is dead, replaced by a plugin list inside the
config of the site plugin.

I've determined by experiment that even constructing a lifecycle for
"site:site" does not give me the plugin executions from inside the
site plugin.

So, folks would like to propagate config from reporting plugins to
Eclipse plugins. Any ideas?


Back to the top