Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since war overlays and war packaging all seems to happen as part of a single goal, I don't think there's a way to get in the middle of it. As a workaround, you could extract <code>web.xml</code> in an earlier phase and process it. The maven-dependency-plugin can be used in Project B to extract <code>web.xml</code> from Project A into a work directory, then run maven-config-processor-plugin on <code>web.xml</code> and place the result somewhere else, then instruct maven-war-plugin to include that processed <code>web.xml</code> before overlays. In Project B's POM:</p> <pre><code>&lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;2.4&lt;/version&gt; &lt;executions&gt; &lt;!-- Extract web.xml from Project A --&gt; &lt;execution&gt; &lt;id&gt;unpack-webxml&lt;/id&gt; &lt;phase&gt;generate-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;your.group&lt;/groupId&gt; &lt;artifactId&gt;project.a&lt;/artifactId&gt; &lt;version&gt;...&lt;/version&gt; &lt;type&gt;war&lt;/type&gt; &lt;overWrite&gt;true&lt;/overWrite&gt; &lt;outputDirectory&gt;${project.build.directory}/myconfig/work&lt;/outputDirectory&gt; &lt;includes&gt;WEB-INF/web.xml&lt;/includes&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;com.google.code.maven-config-processor-plugin&lt;/groupId&gt; &lt;artifactId&gt;maven-config-processor-plugin&lt;/artifactId&gt; &lt;version&gt;2.0&lt;/version&gt; &lt;executions&gt; &lt;!-- Process extracted web.xml and place in temp build directory --&gt; &lt;execution&gt; &lt;id&gt;process-webxml&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;process&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;outputDirectory&gt;${project.build.directory}/myconfig/build&lt;/outputDirectory&gt; &lt;transformations&gt; &lt;transformation&gt; &lt;input&gt;${project.build.directory}/myconfig/work/WEB-INF/web.xml&lt;/input&gt; &lt;output&gt;WEB-INF/web.xml&lt;/output&gt; &lt;!-- your transformation config --&gt; &lt;/transformation&gt; &lt;/transformations&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;version&gt;2.1.1&lt;/version&gt; &lt;configuration&gt; &lt;webResources&gt; &lt;!-- Instruct war plugin to include temp build directory in webapp --&gt; &lt;resource&gt; &lt;directory&gt;${project.build.directory}/myconfig/build&lt;/directory&gt; &lt;includes&gt; &lt;include&gt;**&lt;/include&gt; &lt;/includes&gt; &lt;/resource&gt; &lt;/webResources&gt; &lt;overlays&gt; &lt;!-- Overlay customization if needed --&gt; &lt;/overlays&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; </code></pre> <p>As far as I can tell, the war plugin includes <code>webResources</code> first, followed by <code>src/main/webapp</code>, followed by overlays.</p> <p>I'm not familiar with maven-config-processor-plugin, so I apologize if my configuration there is not correct.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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