Hi Baptiste,

first thanks for the links and answers...

> Here's the thread:
http://maven.40175.n5.nabble.com/Maven2-Maven3-plugin-development-Ensuring-only-the-available-parameters-are-allowed-tp5780854p5780948.html

Maybe I'd try something along those lines:

Plugin plugin = lookupThePluginYouWant(project.getBuildPlugins());
Xpp3Dom config = (Xpp3Dom) plugin.getConfiguration();
// Unleash hell

This brought me into the right direction....

What i have so far:

Using the following:

    @Component
    private PluginDescriptor pluginDescriptor;


and now in the and execution method of a mojo like this:


Xpp3Dom globalConfiguration = (Xpp3Dom) pluginDescriptor.getPlugin().getConfiguration();

This will give me the global configuration which means the part...

<plugin>
  <g...>..</g..>
  <a...>..</a..>
  <v...>..</v..>
  <configuration>
    <!-- Global Configuration -->
  </configuration>
  <executions>
    <execution>
      <id>...</id>
      <configuration>
        <!-- exec configuration -->
      </configuration>
    ...
 </...

via the following code snippet i can get access to the
exec configurations:

List<PluginExecution> executions = pluginDescriptor.getPlugin().getExecutions();
for ( PluginExecution pluginExecution : executions )
{
Xpp3Dom executionConfiguration = (Xpp3Dom) pluginExecution.getConfiguration();
}

but now I have the problem which of the exec configuration is one which currently being executed ? Of course i can iterator through the list of executions, but how do i know which is the correct one ?


Kind regards
Karl Heinz Marbaise


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

Reply via email to