各モジュールが常に親と同じバージョンを維持するようにする Maven マルチモジュール プロジェクトでは、通常、モジュールの pom.xml で次のようなことを行いました。
<parent>
<groupId>com.groupId</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.1-SNAPSHOT</version>
</parent>
<groupId>com.groupId</groupId>
<artifactId>artifactId</artifactId>
<packaging>jar</packaging>
<version>${project.parent.version}</version>
<name>name</name>
Maven 3.0-alpha-5 の使用を開始したため、次の警告が表示されます。
[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]
モジュールのバージョンを親バージョンに結び付けることの本当の問題が何か知りたいです。または、これは、project.parent.version であるかどうかに関係なく、version 要素に式が使用されている場合の一般的な警告の場合ですか。