[Backport 4.0.x] Improve standalone ApiRunner to properly apply settings - #13014
Merged
Conversation
The standalone ApiRunner is the main entry point for using the Maven 4 API outside of a full Maven build (e.g. in tools like mvnup). This improves it to be production-ready: - Remove hardcoded user.home = "target" — read settings from real user home - Store effective settings on the session (session.getSettings() returns actual settings) - Apply proxy, mirror, and server authentication from settings.xml - Configure dependency resolution machinery (DependencyTraverser, DependencyManager, etc.) - Support encrypted settings passwords with SecurityMode enum (NONE, IF_AVAILABLE, IF_AVAILABLE_WARN, REQUIRED) - Load maven-system.properties and maven-user.properties - Detect and set Maven version from classpath pom.properties - Honor offline mode from settings - Use ApiRunner-provided repositories in mvnup instead of replacing them
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
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
Backport of #12998 to
maven-4.0.x.The standalone
ApiRunneris the main entry point for using the Maven 4 API outside of a full Maven build (e.g. in tools like mvnup). This improves it to be production-ready:user.home = "target"— read settings from real user homesettings.xmlSecurityModeenummaven-system.propertiesandmaven-user.propertiespom.propertiesTest plan
maven-4.0.x🤖 Generated with Claude Code