Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to invoke the same maven build twice in one call
    primarykey
    data
    text
    <p>Is it possible to invoke the same maven build a number of times with different configuration parameters?</p> <p>I have a maven build that creates a number RPMs with the rpm-maven-plugin. I pass it a variable (<code>environment</code>) which specifies which environment the RPM is targeted for: development, staging or production. </p> <p>To create all RPMs for all environments, I call <code>mvn package -Denvironment=...</code> 3 times; and I'd like to simplify that. It would be great if I could call <code>mvn package</code> once, and it, in turn, would build three RPMs for all environments.</p> <p>Do you see any way of doing this?</p> <h2>Edit 1</h2> <p>So far (based on <a href="https://stackoverflow.com/questions/7239786/how-to-invoke-the-same-maven-build-twice-in-one-call/7239999">dm3's great answer</a>), I can create three independent RPMs in one build, with the same properties. The problem now is to be able to change the <code>environment</code> property for each execution. Any suggestions?</p> <pre><code>&lt;project&gt; &lt;properties&gt; &lt;!-- Default Environment --&gt; &lt;environment&gt;development&lt;/environment&gt; &lt;/properties&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;rpm-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.1-alpha-1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;id&gt;package-development&lt;/id&gt; &lt;goals&gt;&lt;goal&gt;rpm&lt;/goal&gt;&lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;id&gt;package-staging&lt;/id&gt; &lt;goals&gt;&lt;goal&gt;rpm&lt;/goal&gt;&lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;id&gt;package-production&lt;/id&gt; &lt;goals&gt;&lt;goal&gt;rpm&lt;/goal&gt;&lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;pluginManagement&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;rpm-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.1-alpha-1&lt;/version&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; ... VERY LONG CONFIG ... &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/pluginManagement&gt; &lt;/build&gt; &lt;/project&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.
    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