[MNG-6752] submodule with $revision version can't be referenced by a normal version number
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 21h 11m
- Merged PRs (30d)
- 312
Description
**[Martin K](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=martin.koegler@brz.gv.at)** opened **[MNG-6752](https://issues.apache.org/jira/browse/MNG-6752?redirect=false)** and commented
In the following example, pp/pom.xml can't reference its parent with a specific version number ("\1-SNAPSHOT\") - 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:
```
4.0.0
pp
y-pom
yy
pom
1-SNAPSHOT
pp1
pp
1-SNAPSHOT
```
File ./pp/pom.xml:
```
4.0.0
pp
pp-pom
PP
pom
${revision}
pp1
pp-pom
1-SNAPSHOT
../pp1/pom.xml
1-SNAPSHOT
```
File ./pp1/pom.xml:
```
4.0.0
pp1
pp-pom
PP
pom
${revision}
1-SNAPSHOT
```
---
**Affects:** 3.6.1
Contributor guide
Research direction
Reproduce the failure using the root pom.xml, pp/pom.xml, and pp1/pom.xml shown in the issue, with the artifacts absent from local and remote repositories. Start by tracing how Maven reads and caches parent POMs before resolving ${revision}. Done means the build succeeds when pp/pom.xml references its parent with the concrete 1-SNAPSHOT version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100