Hi all,<div><br></div><div>I&#39;ve been working on some Forge plugins that require adding plugins to the Maven configuration. For example:</div><div><br></div><div><div> &lt;plugin&gt;</div><div>                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;</div>
<div>                &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;</div><div>                &lt;version&gt;3.0-beta-3&lt;/version&gt;</div><div>                &lt;configuration&gt;</div><div>                    &lt;reportPlugins&gt;</div>
<div>                        &lt;plugin&gt;</div><div>                            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;</div><div>                            &lt;artifactId&gt;findbugs-maven-plugin&lt;/artifactId&gt;</div>
<div>                            &lt;version&gt;2.3.2&lt;/version&gt;</div><div>                        &lt;/plugin&gt;</div><div>                    &lt;/reportPlugins&gt;</div><div>                &lt;/configuration&gt;</div>
<div>            &lt;/plugin&gt;</div></div><div><br></div><div>It&#39;s fairly easy to add a new plugin, all tough the get/set API of Maven is not great. Adding configuration to a plugin (as in the above example) is very painful though because you need to parse the XML from a string. We should have a builder API like the one available for adding dependencies. I would be happy to work on this, but I want to discuss what&#39;s the best way to approach this. The difficult thing is that anything could be within the configuration tag. </div>
<div><br></div><div>One option would be to use Groovy for this. Groovy has an excellent XML builder. Plugin authors could use Groovy directly to create the XML structure, we should only provide an Adaptor to easily transform the Groovy node structure to a Maven node structure. On top of that we could provide a Java API like this:</div>
<div>configuration.addElement(&quot;reportPlugins&quot;)</div><div>   .addElement(&quot;plugin&quot;)</div><div>   .addElement(&quot;groupId&quot;) etc.</div><div><br></div><div>With Groovy it would also be easy to, for example, check if an configuration element already exists.</div>
<div>If we would use Groovy that means Groovy has to be on the classpath too of course.</div><div><br></div><div>Paul</div>