I have dozens of similar but not identical plugin execution configurations. I'd like to re-use parts of them.
The part that I'd like to re-use might look like this:
<reuseMe>
<lotsOfXML/>
</reuseMe>
Now, some plugin configurations might not contain the above:
<configuration>
<simpleStuff/>
</configuration>
But other plugin configurations might:
<configuration>
<simpleStuff/>
<complexStuff>
<reuseMe>
<lotsOfXML/>
</reuseMe>
</complexStuff>
</configuration>
Instead of copy pasting that fragment, which is always the same, I'd like some mechanism where I can declare reusable XML fragments, and then just "import" them:
<configuration>
<simpleStuff/>
<complexStuff>
<reuseMe import="whatever"/>
</complexStuff>
</configuration>
Short of XSL transforming my pom.xml
files in a preprocessing step, is there any out-of-the-box way this can be done with vanilla Maven? Using <pluginManagement/>
doesn't seem to work because that would define the <reuseMe/>
content for all plugin executions as a default, not just for those that need this.