Note that there are some explanatory texts on larger screens.

plurals
  1. POCan you refactor Maven pom.xml files into reusable XML fragments?
    primarykey
    data
    text
    <p>In Maven, is it possible to refactor commonly repeated fragments into a reusable "library" (plugin)? I realize that I can write my own plugins, but often the functionality I want to re-use is already expressed as fragments in a pom.xml, and my natural inclination is that the mechanism of re-use should preserve those fragments <em>as</em> XML.</p> <p><strong>Case in point</strong> I've been using a procedure (<a href="http://wikis.sun.com/display/Jersey/HowToConfigureExtendedWADL" rel="noreferrer">partly described here</a>) for generating a WADL file from Jersey/JAX-RS source code, and then generating developer documentation from that WADL and the source-code's own Javadoc. The procedure on that page describes the execution of two plugins, and I am using a third plugin (org.codehaus.mojo:exec-xsltproc) and my own XSL file to turn the WADL into HTML.</p> <p>I've used this procedure in several Maven projects. The boilerplate comes in at <a href="http://pastie.org/1880764" rel="noreferrer">100 lines of XML</a>. What changes between projects is simply the package name of the source code in question (<code>com.example.myapp.rest</code> in the linked boilerplate). Therefore it is not possible to move this into a parent pom, or any other mechanism that does not allow parametrization.</p> <p><strong>What I want</strong> is to aggregate, template-out, or otherwise refactor those 100 lines (and one XST file) into a common location. I realize that re-usable maven executions are delivered via Maven plugins. Ideally I wouldn't have to write any Java (or Groovy) just to re-express what I have already expressed in XML.</p> <p><strong>Is it possible to refactor Maven pom.xml files <em>as</em> XML?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload