[ https://issues.apache.org/jira/browse/MNG-6608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16800745#comment-16800745 ]
Markus Meisterernst edited comment on MNG-6608 at 3/25/19 2:32 PM: ------------------------------------------------------------------- [~khmarbaise], you are right, it is definitely a Bug that the ${revision} Property isn't replaced int the Local Maven Repository (the POM file next to the artifacts and the reactor/intermediate POMs). As a consequence, you cannot refer to an Maven Artifact from another Project. We use for example a Third-Party Project in an OSGi Context that takes care of Bundling alls 3rd-Party Libraries and some own extensions to an Installation Package, that has its own Lifecycle. Apart from the Third-Party Project we have our main Application of course, which is not able to refer to dependencies bundled by the Third Party Project, when we introduce the ${revision} property there: {code:java} Failed to execute goal on project <project>: Could not resolve dependencies for project <Referencing Module>: Failed to collect dependencies at <3rd-Party Dependency>:jar:6.9-SNAPSHOT: Failed to read artifact descriptor for <3rd-Party Dependency>:jar:6.9-SNAPSHOT: Could not transfer artifact <3rd-Party Dependency>:pom:${revision} from/to <OUR NEXUS> ...{code} Feels like maven is going nuts/schizophren (it knows what it needs, but then looks up the POM and bang !). Do you think we need yet another Bug Ticket in this area (as there are already a few) ? was (Author: pingid21): [~khmarbaise], you are right, it is definitely a Bug that the ${revision} Property isn't replaced int the Local Maven Repository. As a consequence, you cannot refer to an Maven Artifact from another Project. We use for example a Third-Party Project in an OSGi Context that takes care of Bundling alls 3rd-Party Libraries and some own extensions to an Installation Package, that has its own Lifecycle. Apart from the Third-Party Project we have our main Application of course, which is not able to refer to dependencies bundled by the Third Party Project, when we introduce the ${revision} property there: {code:java} Failed to execute goal on project <project>: Could not resolve dependencies for project <Referencing Module>: Failed to collect dependencies at <3rd-Party Dependency>:jar:6.9-SNAPSHOT: Failed to read artifact descriptor for <3rd-Party Dependency>:jar:6.9-SNAPSHOT: Could not transfer artifact <3rd-Party Dependency>:pom:${revision} from/to <OUR NEXUS> ...{code} Feels like maven is going nuts/schizophren (it knows what it needs, but then looks up the POM and bang !). Do you think we need yet another Bug Ticket in this area (as there are already a few) ? > Why can't project.version in pom.xml be set as a variable? > ---------------------------------------------------------- > > Key: MNG-6608 > URL: https://issues.apache.org/jira/browse/MNG-6608 > Project: Maven > Issue Type: New Feature > Components: Design, Patterns & Best Practices > Affects Versions: 3.6.0 > Reporter: chenxiaoyong > Priority: Major > Attachments: example.zip, revision-test.zip > > > we need modify project.version in pom.xml when we merge source code from > develope branch to master branch in git. it‘s troublesome! > Why can't project.version in pom.xml be set as a variable? > for example: > {code:xml} > <project ... > > <modelVersion>4.0.0</modelVersion> > <groupId>org.example</groupId> > <artifactId>example</artifactId> > <version>${project-version}</version> > <packaging>jar</packaging> > <properties> > <project-version>1.0.0-SNAPSHOT</project-version> > </properties> > <profiles> > <profile> > <!-- snapshot --> > <id>dev</id> > <properties> > <profiles.active>dev</profiles.active> > <project-version>1.0.0-SNAPSHOT</project-version> > </properties> > <activation> > <activeByDefault>true</activeByDefault> > </activation> > </profile> > <profile> > <!-- RELEASE --> > <id>release</id> > <properties> > <profiles.active>release</profiles.active> > <project-version>1.0.0-RELEASE</project-version> > </properties> > </profile> > </profiles> > > </project> > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)