Skip to content

Introduce validation control - #12549

Merged
cstamas merged 1 commit into
apache:maven-3.10.xfrom
cstamas:maven-3.10.x-validation-control
Jul 27, 2026
Merged

cstamas merged 1 commit into
apache:maven-3.10.xfrom
cstamas:maven-3.10.x-validation-control

Conversation

@cstamas

@cstamas cstamas commented Jul 27, 2026

Copy link
Copy Markdown
Member

Enables validation level choice in Maven Resolver validator.

This change should go to every Maven version having MavenValidator (3.10, 4.0 and 4.1).

Related: apache/maven-resolver#2007

Backport of: 5703b7d

Enables validation level choice in Maven Resolver validator.

This change should go to every Maven version having `MavenValidator` (3.10, 4.0 and 4.1).

Related: apache/maven-resolver#2007

Backport of: 5703b7d
@cstamas cstamas added this to the 3.10.0 milestone Jul 27, 2026
@cstamas cstamas self-assigned this Jul 27, 2026
@cstamas cstamas added the enhancement New feature or request label Jul 27, 2026
@cstamas
cstamas marked this pull request as ready for review July 27, 2026 18:33

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Clean backport of merged PR #12520 (commit 5703b7d) to the maven-3.10.x branch.

The changes are minimal and correctly adapted for the 3.10.x branch:

  • Traditional switch statement instead of switch expression (Java compatibility)
  • javax.inject imports instead of org.apache.maven.api.di
  • Config key defined as a local constant rather than referencing Constants.MAVEN_RESOLVER_VALIDATION (which doesn't exist on 3.10.x)
  • Source files under maven-core/ rather than impl/maven-impl/

The offValidator = new Validator() {} pattern is correct — all five methods on the Validator interface are default methods, so the anonymous class produces a complete no-op validator.

Note: The same case-sensitivity concern from the maven-4.0.x companion PR (#12548) applies here — ConfigUtils.getEnum uses Enum.valueOf which is case-sensitive, but the documented values are lowercase. See the review on #12548 for details.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 27, 2026
@cstamas
cstamas merged commit 2bc0aea into apache:maven-3.10.x Jul 27, 2026
18 checks passed
@cstamas
cstamas deleted the maven-3.10.x-validation-control branch July 27, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants