-
Couldn't load subscription status.
- Fork 2.8k
Compat: preserve/interpolate repository URLs; improved validation messaging #11140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cstamas
approved these changes
Sep 17, 2025
rmannibucau
approved these changes
Sep 17, 2025
9bcafc8 to
18a82c6
Compare
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Oct 6, 2025
This commit enables repository URL interpolation in Maven 4 while maintaining
backward compatibility and improving validation messaging. The changes address
the overly restrictive approach that previously disabled repositories with
any expressions beyond project.basedir and project.rootDirectory.
Key changes:
- DefaultModelBuilder: Add repository URL interpolation during model building
for repositories, pluginRepositories, profiles, and distributionManagement
- DefaultModelValidator: Replace restrictive expression validation with
unresolved placeholder detection that fails at resolution time
- CompatibilityFixStrategy: Remove repository disabling logic, replace with
informational logging for interpolated URLs
- Add comprehensive integration tests for both successful interpolation and
failure cases with unresolved placeholders
The new approach allows legitimate use cases like ${env.REPO_URL} while still
catching unresolved placeholders when repositories are actually used, providing
better user experience and maintaining Maven's robustness.
Fixes apache#11140
127929a to
d15b581
Compare
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Oct 6, 2025
This commit enables repository URL interpolation in Maven 4 while maintaining
backward compatibility and improving validation messaging. The changes address
the overly restrictive approach that previously disabled repositories with
any expressions beyond project.basedir and project.rootDirectory.
Key changes:
1. DefaultModelBuilder: Add repository URL interpolation during model building
- Support for repositories, pluginRepositories, profiles, and distributionManagement
- Add project.basedir.uri and project.rootDirectory.uri expressions for MNG-8465
- Provides both string and URI formats for basedir and rootDirectory properties
2. DefaultModelValidator: Replace restrictive expression validation with proper flow
- Remove premature expression validation from model validator
- Allow expressions to pass through model validation and fail at repository resolution time
- Repository URL interpolation is now allowed; unresolved placeholders fail during resolution
- This matches the intended design where MavenValidator in resolver catches uninterpolated expressions
3. CompatibilityFixStrategy: Remove repository disabling logic, replace with
informational logging for interpolated URLs
4. Add comprehensive integration tests for both successful interpolation and
failure cases with unresolved placeholders:
- MavenITgh11140RepoInterpolationTest: Tests successful interpolation from env and properties
- MavenITgh11140RepoDmUnresolvedTest: Tests failure with unresolved placeholders
- Updated tests to use dependency:resolve and -e flag to capture proper error messages
5. Enhanced test coverage:
- Update unit test expectations to reflect corrected validation flow
- Add test case for unsupported expressions
- Apply code formatting fixes with spotless
The new approach allows legitimate use cases like ${env.REPO_URL} while still
catching unresolved placeholders when repositories are actually used, providing
better user experience and maintaining Maven's robustness.
This resolves the MNG-8465 integration test failure and fixes apache#11140.
cc5bc99 to
829b79f
Compare
This commit enables repository URL interpolation in Maven 4 while maintaining
backward compatibility and providing early validation of unresolved expressions.
Repository URLs can now use expressions like ${env.REPO_URL} and ${project.basedir.uri}
which are interpolated during model building.
Key changes:
1. DefaultModelBuilder: Add repository URL interpolation during model building
- Support for repositories, pluginRepositories, profiles, and distributionManagement
- Provide basedir, project.basedir, project.basedir.uri, project.rootDirectory,
and project.rootDirectory.uri properties for interpolation
- Enable environment variable and project property interpolation in repository URLs
2. DefaultModelValidator: Validate interpolated repository URLs for unresolved expressions
- Repository URL expressions are interpolated during model building
- After interpolation, any remaining ${...} expressions cause validation errors
- Early failure during model validation provides clear error messages
3. CompatibilityFixStrategy: Remove repository disabling logic, replace with
informational logging for interpolated URLs
4. Add integration tests for repository URL interpolation:
- Test successful interpolation from environment variables and project properties
- Test early failure when expressions cannot be resolved during model building
The new approach enables legitimate use cases while providing early, clear error
messages for unresolved expressions during the validate phase rather than later
during repository resolution.
829b79f to
beacd66
Compare
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Oct 7, 2025
…1140) This commit enables repository URL interpolation in Maven 4 while maintaining backward compatibility and providing early validation of unresolved expressions. Repository URLs can now use expressions like ${env.REPO_URL} and ${project.basedir.uri} which are interpolated during model building. Key changes: 1. DefaultModelBuilder: Add repository URL interpolation during model building - Support for repositories, pluginRepositories, profiles, and distributionManagement - Provide basedir, project.basedir, project.basedir.uri, project.rootDirectory, and project.rootDirectory.uri properties for interpolation - Enable environment variable and project property interpolation in repository URLs 2. DefaultModelValidator: Validate interpolated repository URLs for unresolved expressions - Repository URL expressions are interpolated during model building - After interpolation, any remaining ${...} expressions cause validation errors - Early failure during model validation provides clear error messages 3. CompatibilityFixStrategy: Remove repository disabling logic, replace with informational logging for interpolated URLs 4. Add integration tests for repository URL interpolation: - Test successful interpolation from environment variables and project properties - Test early failure when expressions cannot be resolved during model building The new approach enables legitimate use cases while providing early, clear error messages for unresolved expressions during the validate phase rather than later during repository resolution. (cherry picked from commit 210dbdc) # Conflicts: # impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java # impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
gnodet
added a commit
that referenced
this pull request
Oct 7, 2025
This commit enables repository URL interpolation in Maven 4 while maintaining
backward compatibility and providing early validation of unresolved expressions.
Repository URLs can now use expressions like ${env.REPO_URL} and ${project.basedir.uri}
which are interpolated during model building.
Key changes:
1. DefaultModelBuilder: Add repository URL interpolation during model building
- Support for repositories, pluginRepositories, profiles, and distributionManagement
- Provide basedir, project.basedir, project.basedir.uri, project.rootDirectory,
and project.rootDirectory.uri properties for interpolation
- Enable environment variable and project property interpolation in repository URLs
2. DefaultModelValidator: Validate interpolated repository URLs for unresolved expressions
- Repository URL expressions are interpolated during model building
- After interpolation, any remaining ${...} expressions cause validation errors
- Early failure during model validation provides clear error messages
3. CompatibilityFixStrategy: Remove repository disabling logic, replace with
informational logging for interpolated URLs
4. Add integration tests for repository URL interpolation:
- Test successful interpolation from environment variables and project properties
- Test early failure when expressions cannot be resolved during model building
The new approach enables legitimate use cases while providing early, clear error
messages for unresolved expressions during the validate phase rather than later
during repository resolution.
(cherry picked from commit 210dbdc)
# Conflicts:
# impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java
# impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
gnodet
added a commit
that referenced
this pull request
Oct 8, 2025
This commit enables repository URL interpolation in Maven 4 while maintaining
backward compatibility and providing early validation of unresolved expressions.
Repository URLs can now use expressions like ${env.REPO_URL} and ${project.basedir.uri}
which are interpolated during model building.
Key changes:
1. DefaultModelBuilder: Add repository URL interpolation during model building
- Support for repositories, pluginRepositories, profiles, and distributionManagement
- Provide basedir, project.basedir, project.basedir.uri, project.rootDirectory,
and project.rootDirectory.uri properties for interpolation
- Enable environment variable and project property interpolation in repository URLs
2. DefaultModelValidator: Validate interpolated repository URLs for unresolved expressions
- Repository URL expressions are interpolated during model building
- After interpolation, any remaining ${...} expressions cause validation errors
- Early failure during model validation provides clear error messages
3. CompatibilityFixStrategy: Remove repository disabling logic, replace with
informational logging for interpolated URLs
4. Add integration tests for repository URL interpolation:
- Test successful interpolation from environment variables and project properties
- Test early failure when expressions cannot be resolved during model building
The new approach enables legitimate use cases while providing early, clear error
messages for unresolved expressions during the validate phase rather than later
during repository resolution.
(cherry picked from commit 210dbdc)
# Conflicts:
# impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java
# impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
gnodet
added a commit
that referenced
this pull request
Oct 8, 2025
…11210) This commit enables repository URL interpolation in Maven 4 while maintaining backward compatibility and providing early validation of unresolved expressions. Repository URLs can now use expressions like ${env.REPO_URL} and ${project.basedir.uri} which are interpolated during model building. Key changes: 1. DefaultModelBuilder: Add repository URL interpolation during model building - Support for repositories, pluginRepositories, profiles, and distributionManagement - Provide basedir, project.basedir, project.basedir.uri, project.rootDirectory, and project.rootDirectory.uri properties for interpolation - Enable environment variable and project property interpolation in repository URLs 2. DefaultModelValidator: Validate interpolated repository URLs for unresolved expressions - Repository URL expressions are interpolated during model building - After interpolation, any remaining ${...} expressions cause validation errors - Early failure during model validation provides clear error messages 3. CompatibilityFixStrategy: Remove repository disabling logic, replace with informational logging for interpolated URLs 4. Add integration tests for repository URL interpolation: - Test successful interpolation from environment variables and project properties - Test early failure when expressions cannot be resolved during model building The new approach enables legitimate use cases while providing early, clear error messages for unresolved expressions during the validate phase rather than later during repository resolution. (cherry picked from commit 210dbdc) # Conflicts: # impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java # impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
This was referenced Oct 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary