Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Shek's answer is probably 'the maven way', so I'll accept it as the correct answer. However, we are not ready to change our conventions, so here is the workaround that we are using.</p> <p>By using a level of indirection you can pass a version number in to the pom at build time and have the install and deploy plugins use them. For example:</p> <pre><code>&lt;project xmlns="..." xmlns:xsi="..." xsi:schemaLocation="..."&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.stackoverflow&lt;/groupId&gt; &lt;artifactId&gt;stackoverflow&lt;/artifactId&gt; &lt;version&gt;${ciVersion}&lt;/version&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;name&gt;StackOverflow&lt;/name&gt; &lt;properties&gt; &lt;ciVersion&gt;0.0.0.0&lt;/ciVersion&gt; &lt;/properties&gt; ... &lt;/project&gt; </code></pre> <p>We cannot override ${project.version} directly. So instead, we add a second property called 'ciVersion' and give it a default value of '0.0.0.0' in the properties section. Now the CI server can specify a version number by overriding the ciVersion property on the command line. As in:</p> <pre><code>mvn -DciVersion=1.0.0.25 install </code></pre> <p>The install and deploy plugins will use the value of the ciVersion property that was passed in whenever ${project.version} is referenced, as expected, and the default value will be used when no version is provided on the command line. This allows us to switch to maven with minimal impact on our process. In addition, this workaround is unobtrusive, allowing for an easy switch to the SNAPSHOT functionality when desired.</p>
    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.
    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.
    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