You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2017/06/26 17:55:00 UTC
[jira] [Closed] (MNG-6244) Cannot build project sub-module when
property is used for project version
[ https://issues.apache.org/jira/browse/MNG-6244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karl Heinz Marbaise closed MNG-6244.
------------------------------------
Resolution: Not A Problem
Assignee: Karl Heinz Marbaise
It's good that you already found the solution. The documentation says explicitly so https://maven.apache.org/maven-ci-friendly.html
The point is if you do an install without Flatten-Maven-Plugin of such pom's which contain {{${revision}}} the installed pom in local repository keep containing {{${revision}}} which means Maven can't solve them...
> Cannot build project sub-module when property is used for project version
> --------------------------------------------------------------------------
>
> Key: MNG-6244
> URL: https://issues.apache.org/jira/browse/MNG-6244
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.5.0
> Reporter: Bogdan Ilchyshyn
> Assignee: Karl Heinz Marbaise
> Attachments: clean-install-root.log, clean-install-submodule.log, sources.tar.gz
>
>
> Consider simple multi-module project (see [^sources.tar.gz]):
> {noformat}
> parent/pom.xml
> parent/module-a
> parent/module-b
> {noformat}
> {{parent}} has defined project version via property {{revision}}:
> {code:xml}
> <version>${revision}</version>
>
> <properties>
> <revision>1.0.0-SNAPSHOT</revision>
> </properties>
> {code}
> Both sub-modules ({{module-a}} and {{module-b}}) define parent versions via this property:
> {code:xml}
> <parent>
> <groupId>test</groupId>
> <artifactId>parent</artifactId>
> <version>${revision}</version>
> </parent>
> {code}
> Sub-module {{module-b}} has a dependency to {{module-a}}:
> {code:xml}
> <dependency>
> <groupId>test</groupId>
> <artifactId>module-a</artifactId>
> <version>${project.version}</version>
> </dependency>
> {code}
> The project is built successfully from the root (see [^clean-install-root.log] for build log).
> Also there is no problem to build {{module-a}} independently (i.e. {{cd module-a && mvn clean install}}).
> But when trying to build {{module-b}} (i.e. {{cd module-b && mvn clean install}}), build fails (see [^clean-install-submodule.log]):
> {noformat}
> [ERROR] Failed to execute goal on project module-b: Could not resolve dependencies for project test:module-b:jar:1.0.0-SNAPSHOT: Failed to collect dependencies at test:module-a:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for test:module-a:jar:1.0.0-SNAPSHOT: Could not find artifact test:parent:pom:${revision} in central (https://repo.maven.apache.org/maven2) -> [Help 1]
> {noformat}
> Changing {{$\{project.version\}}} directly to {{$\{revision\}}} produces the same output.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)