In Maven, is it possible to reorganize frequently repeated fragments into a reusable βlibraryβ (plugin)? I understand that I can write my own plugins, but often the functionality that I want to reuse is already expressed as fragments in pom.xml, and my natural tendency is that the reuse mechanism should save these fragments as XML.
Case at Point I used a procedure ( partially described here ) to create a WADL file from Jersey / JAX -RS, and then generate the developer documentation from that WADL and my own Javadoc source code. The procedure on this page describes the execution of two plugins, and I use the third plugin (org.codehaus.mojo: exec-xsltproc) and my own XSL file to turn WADL into HTML.
I have used this procedure in several Maven projects. The template comes in 100 lines of XML . What changes between projects is just the name of the source package ( com.example.myapp.rest in the associated template). Therefore, it is impossible to move this to the parent pom or any other mechanism that does not allow parameterization.
What I want is to aggregate, expose templates or otherwise reorganize these 100 lines (and one XST file) into a shared folder. I understand that restarted maven executions are done through Maven plugins. Ideally, I would not have to write Java (or Groovy) to re-express what I have already expressed in XML.
Is it possible to refactor Maven pom.xml files as XML?
Matt quail
source share