Skip to content

[Backport 4.0.x] Improve standalone ApiRunner to properly apply settings - #13014

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12998-to-maven-4.0.x
Sep 2, 2026
Merged

[Backport 4.0.x] Improve standalone ApiRunner to properly apply settings#13014
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12998-to-maven-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12998 to maven-4.0.x.

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
  • Apply proxy, mirror, and server authentication from settings.xml
  • Configure dependency resolution machinery
  • Support encrypted settings passwords with SecurityMode enum
  • 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

Test plan

  • Cherry-pick applied cleanly (no conflicts)
  • CI passes on maven-4.0.x

🤖 Generated with Claude Code

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
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 2, 2026
@gnodet gnodet added enhancement New feature or request backport mvn4 labels Sep 2, 2026
@gnodet gnodet self-assigned this Sep 2, 2026
@gnodet
gnodet merged commit 8d3155a into maven-4.0.x Sep 2, 2026
24 checks passed
@gnodet
gnodet deleted the backport/12998-to-maven-4.0.x branch September 2, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport enhancement New feature or request mvn4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant