Skip to content

Circular Maven ${project.version} resolution#5573

Merged
sambsnyd merged 2 commits intomainfrom
maven-recursive-project-version
Jun 6, 2025
Merged

Circular Maven ${project.version} resolution#5573
sambsnyd merged 2 commits intomainfrom
maven-recursive-project-version

Conversation

@jkschneider
Copy link
Copy Markdown
Member

What's changed?

Solving problems recursively resolving ${project.version}.

Comment on lines +126 to +143
<project>
<groupId>org.example</groupId>
<artifactId>app</artifactId>
<version>${project.version}</version>
<parent>
<groupId>org.example</groupId>
<artifactId>parent</artifactId>
<version>3.17.0</version>
<relativeParent>../pom.xml</relativeParent>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maven itself refuses to parse a pom like this with an error:

[ERROR] Resolving expression: '${project.version}': Detected the following recursive expression cycle in 'project.version': [version] @ com.example:module-b:${project.version}, F:\Projects\maven-scratch\module-b\pom.xml

Comment thread rewrite-maven/src/test/java/org/openrewrite/maven/tree/ResolvedPomTest.java Outdated
…dPomTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sambsnyd sambsnyd merged commit e629be2 into main Jun 6, 2025
2 checks passed
@sambsnyd sambsnyd deleted the maven-recursive-project-version branch June 6, 2025 21:32
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants