Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] m2e Connectors and dependence on plugin

see inline

--
Regards,
Igor

On 11-12-02 2:25 AM, Pino Silvaggio wrote:
Well, lets forget the workspace integration solution for a moment...

The current available methods to retrieve configuration parameters is
limited.
I do not really need the plugin or its structures... Reflection implies
I have the
plugin classes. I only need the parameters in some form.


This is incorrect. Plugin configuration parameter defaults are part of
plugin metadata, but many plugins have default parameter values encoded
in java (as opposed to being captured in plugin metadata) and
interpretation of the effective parameter values is obvious always in
the code. On top of that, set of supported parameters, their defaults
and interpretation change from one version of the plugin to the next.

So at very least you need access to plugin metadata, but if you want to
be sure you really need to delegate to the plugin code. In case of build
avoidance, plexus-build-api already provides API to do workspace
integration proper.

I could read the configuration xml but it's not very elegant. Maybe
that's the only solution?

Look at IMaven.getMojoParameterValue. There are couple of flavours, but
both let you interpret mojo execution configuration parameter as
specific java type. These methods use the same reflection voodoo as used
by Maven core during mojo parameter injection.


On 11/29/2011 07:58 AM, Igor Fedorenko wrote:
The best solution here is to push workspace integration to the Maven
plugin itself (via plexus-build-api). This is the only way to guarantee
workspace and command line builds behave consistently.

You could embed particular version of the maven plugin jar into your m2e
extension (as mentioned by Rafal), but this means your m2e extension
will only work for one version of the configuration data structures.

Another option is to use reflection to access just the configuration
information you need.

--
Regards,
Igor

On 11-11-29 2:10 AM, Pino Silvaggio wrote:
I am writing a truezip connector.

Suppose I need to access the values under files, fileSet, fileSets.

These are structures that I need to figure out if I need to run
the build. For example, if the sources are external to the workspace
I won't run the build on incremental. Else, i'll do the same scan
pattern
to recognize changes... At least this is what I am thinking at this
point...

My question is how do I get access to these classes (files, fileSet and
fileSets) ???

Even though this is a question of my specific case, how would you
access the plugin classes from a connector when needed?

Using pom deps don't work (ignored, of course, osgi...)
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev


Back to the top