Hey Ken,<br><br>Just a short note because it&#39;s late on Sunday :) Take a look at the &quot;XMLParser&quot; class provided by Forge. The Node API there is what I would recommend for this type of use-case. It&#39;s still in the works, though.<br>
<br>Let me know what you think,<br>~Lincoln<br><br><div class="gmail_quote">On Sun, Apr 3, 2011 at 4:29 PM, Paul Bakker <span dir="ltr">&lt;<a href="http://paul.bakker.nl">paul.bakker.nl</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">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><font color="#888888"><div>Paul</div>
</font><br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>