M2 Tip#1: Passing any XML to Mojos
Credit to Peter van de Hoef for posting this tip on the Maven dev mailing list
It is possible to pass an arbitrary XML configuration snippet to a m2 mojo by using the following:
Then, in the pom:
import org.codehaus.plexus.configuration.PlexusConfiguration; … class MyMojo [etc..] { /** * @parameter */ private PlexusConfiguration anything; }
<plugin>
<groupId>org.apache.maven.plugins</groupId>
[etc...]
<configuration>
<anything>
<can go="here"/>
<nested>
<elements and="attributes"/>
</nested>
</anything>
</configuration>
</plugin>