Skip to content

Commit

Permalink
pom: Handle project.parent.version pom property
Browse files Browse the repository at this point in the history
This property is used in some poms to refer to the version of the
parent pom.

Signed-off-by: BJ Hargrave <[email protected]>
  • Loading branch information
bjhargrave committed Feb 22, 2022
1 parent 1df9181 commit 599c072
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions biz.aQute.repository/src/aQute/maven/provider/POM.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,16 @@ private POM(MavenRepository repo, File base, Document doc, boolean ignoreIfParen
properties.put("pom.groupId", group);
properties.put("pom.artifactId", artifact);
properties.put("pom.version", version);
if (parent.revision != null)
properties.put("parent.version", parent.getVersion()
.toString());
else
properties.put("parent.version", "parent version from " + revision + " but not parent?");
if (parent.revision != null) {
String parentVersionString = parent.getVersion()
.toString();
properties.put("project.parent.version", parentVersionString);
properties.put("parent.version", parentVersionString);
} else {
String parentVersionString = "parent version from " + revision + " but not parent?";
properties.put("project.parent.version", parentVersionString);
properties.put("parent.version", parentVersionString);
}
properties.put("version", version);
properties.put("pom.currentVersion", version);
properties.put("pom.packaging", this.packaging);
Expand Down

0 comments on commit 599c072

Please sign in to comment.