Note that there are some explanatory texts on larger screens.

plurals
  1. POWarning on using project.parent.version as the version of a module in Maven 3
    primarykey
    data
    text
    <p>In maven multi-module projects where I want each of the modules to always keep the same version as the parent, I've typically done something like the following in the module's pom.xml:</p> <pre class="lang-xml prettyprint-override"><code> &lt;parent&gt; &lt;groupId&gt;com.groupId&lt;/groupId&gt; &lt;artifactId&gt;parentArtifactId&lt;/artifactId&gt; &lt;version&gt;1.1-SNAPSHOT&lt;/version&gt; &lt;/parent&gt; &lt;groupId&gt;com.groupId&lt;/groupId&gt; &lt;artifactId&gt;artifactId&lt;/artifactId&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;version&gt;${project.parent.version}&lt;/version&gt; &lt;name&gt;name&lt;/name&gt; </code></pre> <p>Since I started using maven 3.0-alpha-5, I get the following warning for doing so.</p> <pre><code>[WARNING] [WARNING] Some problems were encountered while building the effective model for com.groupid.artifactId:name:jar:1.1-SNAPSHOT [WARNING] 'version' contains an expression but should be a constant. @ com.groupid.artifactId:name::${project.parent.version}, /Users/whaley/path/to/project/child/pom.xml [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] </code></pre> <p>I'm curious to know what the real problem with tying a module's version to the parent version is, if any? Or is this a case of a general warning when any expression, regardless of whether it's project.parent.version, is used for the version element.</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.
 

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