views:

177

answers:

1

In order to invoke the maven invoker plugin with the same goal that is currently running in my uber-pom, I need a way to pass the current goal into the invoker-plugin's config.

Somethig like org.apache.maven.plugins maven-invoker-plugin ... ${maven.gaol} ...

Thanks in advance

+1  A: 

The Maven Help plugin might help you get where you want to go. The ${reactorProjects} variable holds what you are looking for, but perhaps not in precisely the format you are looking to reuse it.

You can view all the expressions available to you via:

mvn help:expressions

and then you can test one of them without the tedium of a pom via evaluation:

mvn help:evaluate

which takes you to a prompt you can use to try expressions.

If I use the help:evaluate and type ${reactorProjects}, I'll get a lot of output, but part of which includes the data you are after:

<plugins>
  <plugin>
    <inheritanceApplied>true</inheritanceApplied>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-help-plugin</artifactId>
    <version>2.1</version>
    <extensions>false</extensions>
    <dependencies/>
  </plugin>
</plugins>
<pluginMap class="linked-hash-map">
  <entry>
    <string>org.apache.maven.plugins:maven-help-plugin</string>
    <plugin reference="../../../plugins/plugin"/>
  </entry>
</pluginMap>
Matthew McCullough