You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Martin K (Jira)" <ji...@apache.org> on 2019/08/29 15:28:00 UTC
[jira] [Created] (MNG-6752) submodule with $revision version can't
be referenced by a normal version number
Martin K created MNG-6752:
-----------------------------
Summary: submodule with $revision version can't be referenced by a normal version number
Key: MNG-6752
URL: https://issues.apache.org/jira/browse/MNG-6752
Project: Maven
Issue Type: Bug
Components: Dependencies
Affects Versions: 3.6.1
Reporter: Martin K
In the following example, pp/pom.xml can't reference its parent with a specific version number ("<version>1-SNAPSHOT</version>") - Unless pp1:pp-pom:pom:1-SNAPSHOT is already present in a maven repository, the build will fail.
Maven reads the parent poms and caches them, before resolving $revision. Therefore it just caches the artifact version "${revsion}" and fails to load the local parent pom, if the parent reference does not also use the version "${revision}"
Precondition: Non of these artificats is already present in a local or remote maven repository.
File pom.xml:
{code}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pp</groupId>
<artifactId>y-pom</artifactId>
<name>yy</name>
<packaging>pom</packaging>
<version>1-SNAPSHOT</version>
<modules>
<module>pp1</module>
<module>pp</module>
</modules>
<properties>
<revision>1-SNAPSHOT</revision>
</properties>
</project>
{code}
File ./pp/pom.xml:
{code}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pp</groupId>
<artifactId>pp-pom</artifactId>
<name>PP</name>
<packaging>pom</packaging>
<version>${revision}</version>
<parent>
<groupId>pp1</groupId>
<artifactId>pp-pom</artifactId>
<version>1-SNAPSHOT</version>
<!--<version>${revision}</version>-->
<relativePath>../pp1/pom.xml</relativePath>
</parent>
<properties>
<revision>1-SNAPSHOT</revision>
</properties>
</project>
{code}
File ./pp1/pom.xml:
{code}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pp1</groupId>
<artifactId>pp-pom</artifactId>
<name>PP</name>
<packaging>pom</packaging>
<version>${revision}</version>
<properties>
<revision>1-SNAPSHOT</revision>
</properties>
</project>
{code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)