Skip to content

Maven 3.9.x should use Maven 3.1 validation in strict mode - #1542

Open
gnodet wants to merge 4 commits into
apache:maven-3.10.xfrom
gnodet:fix-validation-level
Open

Maven 3.9.x should use Maven 3.1 validation in strict mode#1542
gnodet wants to merge 4 commits into
apache:maven-3.10.xfrom
gnodet:fix-validation-level

Conversation

@gnodet

@gnodet gnodet commented May 29, 2024

Copy link
Copy Markdown
Contributor

Changes VALIDATION_LEVEL_STRICT from VALIDATION_LEVEL_MAVEN_3_0 (30) to VALIDATION_LEVEL_MAVEN_3_1 (31).

In strict mode (the default for project builds), the getSeverity(request, errorThreshold) method returns ERROR when validationLevel >= threshold and WARNING otherwise. By raising the strict level from 3.0 to 3.1, the following checks are promoted from warnings to errors:

  • Duplicate plugin declarations in build/plugins
  • Banned characters in version strings (e.g. backslash, expression fragments)
  • Unsupported snapshot version formats (non-standard SNAPSHOT qualifiers)
  • Banned characters in repository IDs
  • Reserved repository ID local

Additional warnings are now emitted for:

  • system scope dependency deprecation
  • Hard-coded system paths in systemPath
  • ${basedir}-relative system paths

The test resource duplicate-plugins-merged-pom.xml was updated to move the duplicate plugin into a profile (avoiding the raw validation error while still testing plugin merge behavior).

Unit tests updated to explicitly use VALIDATION_LEVEL_MAVEN_3_0 where the test exercises pre-3.1 behavior, and to use the default (now 3.1) level where the stricter validation is expected.

Companion IT PR: apache/maven-integration-testing#441

@cstamas

cstamas commented May 29, 2024

Copy link
Copy Markdown
Member

Let's see CI, as it may have some quirks...

@cstamas cstamas modified the milestone: 3.9.8 Jun 5, 2024
@cstamas

cstamas commented Jun 5, 2024

Copy link
Copy Markdown
Member

Oups, not yet, these are IT failures...

@gnodet gnodet added the mvn3 label Aug 29, 2024
@gnodet
gnodet marked this pull request as draft January 22, 2025 08:20
@gnodet
gnodet changed the base branch from maven-3.9.x to maven-3.10.x September 2, 2026 21:12
@gnodet gnodet added this to the 3.10.0 milestone Sep 2, 2026
@gnodet
gnodet force-pushed the fix-validation-level branch from 07c67c8 to f92658b Compare September 2, 2026 21:28
@gnodet
gnodet force-pushed the fix-validation-level branch from f92658b to 309feec Compare September 2, 2026 22:03
@gnodet
gnodet marked this pull request as ready for review September 2, 2026 22:17
@gnodet

gnodet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Companion IT PR: apache/maven-integration-testing#441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants