Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude Maven profile name in assembly-plugin built (with dependencies) jar
    primarykey
    data
    text
    <p>I'm using the maven-assembly-plugin to build an executable, monolithic jar with dependencies. I'm also using resource filtering to set some custom, lane-specific (dev, stage, prod, etc) properties. </p> <p>How do I make the finalName of the jar include the lane name (dev, stage, prod, etc)?</p> <p>I'd like the following mvn commands to result in jars that look something like this:</p> <ul> <li>mvn clean install -P DEV --> ws-client-DEV.jar</li> <li>mvn clean install -P STAGE --> ws-client-STAGE.jar</li> <li>mvn clean install -P PROD --> ws-client-PROD.jar</li> </ul> <p>Is there a maven property somewhere I can't find? I would like to avoid using a redundant command line argument if possible (ie - 'mvn clean install -P DEV -Dlane=DEV').</p> <p>Here's my assembly plugin configuration:</p> <pre><code>&lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;version&gt;2.2.2&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;jar-with-dependencies&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;single&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;descriptorRefs&gt; &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt; &lt;/descriptorRefs&gt; &lt;finalName&gt;ws-client&lt;/finalName&gt; &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt; &lt;archive&gt; &lt;manifest&gt; &lt;mainClass&gt;Example&lt;/mainClass&gt; &lt;/manifest&gt; &lt;/archive&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre>
    singulars
    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.
 

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