Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] getMojoParameterValue() for specific types

Reflection is the only reliable way to access types defined in Maven
plugins. Different workspace projects can use different versions of
maven-eclipse-plugin, each plugin version will be loaded into a separate
classloader and reflection is the only way to access classes from plugin
classloaders.

--
Regards,
Igor

On 11-08-31 10:41 AM, Phil Webb wrote:
I am trying to read configuration settings for the
eclipse-maven-plugin
(http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html).
  I have been able to read simple properties using the following code:

MavenSession session = request.getMavenSession();
Plugin plugin = mavenProject.getPlugin(GROUP_ID + ":" + ARTIFACT_ID);
String conf = maven.getMojoParameterValue("workspace", String.class,
session, plugin, plugin, "eclipse");

The problem I have is that I now want to read the additionalConfig
property.  This is a specific EclipseConfigFile type that is defined
as part of the eclipse-maven-plugin.  What is the recommended way of
reading such properties from m2e?  Am I best to try and parse the
configuration DOM myself, or is there an easy way of getting the
eclipse-maven-plugin.jar into the m2e classpath.

Cheers,
Phil.
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev


Back to the top