[ https://issues.apache.org/jira/browse/MNG-6244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16063002#comment-16063002 ]
Bogdan Ilchyshyn commented on MNG-6244: --------------------------------------- We were able to workaround this with [Maven Flatten Plugin|http://www.mojohaus.org/flatten-maven-plugin/flatten-mojo.html]. > 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 > 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)