Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to avoid maven profile duplication
    text
    copied!<p>I have a maven project for a webapp, which repack war dependency using overlays. For two profiles, <em>test</em> and <em>prod</em>, it should exclude <em>demo.jsp</em> file, but for other, for example <em>local</em>, this file should stay. Is there a way to have only one configuration for two profiles? I don't want to repeat one configuration for two profiles. My current solution:</p> <pre class="lang-xml prettyprint-override"><code>&lt;profiles&gt; &lt;profile&gt; &lt;id&gt;test&lt;/id&gt; &lt;build&gt; &lt;plugins&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.3&lt;/version&gt; &lt;configuration&gt; &lt;overlays&gt; &lt;overlay&gt; &lt;groupId&gt;mygroup&lt;/groupId&gt; &lt;artifactId&gt;mywebapp&lt;/artifactId&gt; &lt;excludes&gt; &lt;exclude&gt;demo.jsp&lt;/exclude&gt; &lt;/excludes&gt; &lt;/overlay&gt; &lt;/overlays&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;profile&gt; &lt;id&gt;prod&lt;/id&gt; &lt;build&gt; &lt;plugins&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.3&lt;/version&gt; &lt;configuration&gt; &lt;overlays&gt; &lt;overlay&gt; &lt;groupId&gt;mygroup&lt;/groupId&gt; &lt;artifactId&gt;mywebapp&lt;/artifactId&gt; &lt;excludes&gt; &lt;exclude&gt;demo.jsp&lt;/exclude&gt; &lt;/excludes&gt; &lt;/overlay&gt; &lt;/overlays&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&gt; </code></pre> <p>EDIT: <em>test</em> and <em>prod</em> profiles are identical</p>
 

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