Skip to content

Update Maven version to 4.0.0-SNAPSHOT #2513

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
merged 1 commit into from
Jun 29, 2025

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jun 25, 2025

Summary

This PR updates the Maven version from 4.0.0-rc-4-SNAPSHOT to 4.0.0-SNAPSHOT across all modules and addresses a failing integration test by disabling it for Maven 4.x.

Changes Made

Version Update

  • Version Update: Updated all module versions from 4.0.0-rc-4-SNAPSHOT to 4.0.0-SNAPSHOT
  • All Modules Updated: Updated 41 pom.xml files including root and all submodules
  • Consistent Update: Used systematic approach to ensure consistency across all modules

Integration Test Issue Resolution

  • Disabled MavenITmng3991ValidDependencyScopeTest: Changed version range from [4.0,) to [5.0,)
  • Behavior Change: Maven 4 generates warnings instead of errors for invalid dependency scopes
  • Rationale: Maintains backward compatibility with extensions using custom scopes
  • Future: Test will be re-enabled and potentially updated for Maven 5.0+

Files Modified

Version Updates

  • Root pom.xml
  • All module pom.xml files in:
    • api/ modules (maven-api-*)
    • compat/ modules (maven-artifact, maven-compat, etc.)
    • impl/ modules (maven-cli, maven-core, etc.)
    • its/ modules (integration test support)

Test Configuration

  • its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3991ValidDependencyScopeTest.java

Technical Details

Version Update

  • Updated all inter-module dependencies consistently
  • No manual pom.xml editing conflicts
  • All modules now reference the new 4.0.0-SNAPSHOT version

Integration Test Issue

  • Root Cause: Maven 4 changed behavior to generate warnings instead of errors for invalid dependency scopes
  • Test Expectation: Build should fail when encountering invalid dependency scope invalid
  • Actual Behavior: Build succeeds with warnings about invalid dependency scope
  • Solution: Disabled test for Maven 4.x by changing version range to [5.0,)
  • Reference: Similar fix applied in PR Update Maven version to 4.1.0-SNAPSHOT #2508

Maven 4 Behavior Change

Maven 4 includes this change for backward compatibility:

/*
 * TODO Extensions like Flex Mojos use custom scopes like "merged", "internal", "external", etc. In
 * order to don't break backward-compat with those, only warn but don't error out.
 */
validateEnum(
    prefix,
    "scope",
    problems,
    Severity.WARNING,  // <-- Changed from ERROR to WARNING
    Version.V20,
    d.getScope(),
    // ...
);

Checklist:

  • ✅ Version updated consistently across all modules
  • ✅ All modules updated from 4.0.0-rc-4-SNAPSHOT to 4.0.0-SNAPSHOT
  • ✅ Integration test failure investigated and addressed
  • ✅ Changes committed with descriptive messages
  • ✅ No breaking changes introduced
  • ✅ Test disabled for Maven 4.x to prevent failures
  • ✅ Similar approach to PR Update Maven version to 4.1.0-SNAPSHOT #2508 for consistency

Note: The integration test has been disabled for Maven 4.x due to a behavior change where invalid dependency scopes generate warnings instead of errors. This maintains backward compatibility with extensions that use custom scopes, following the same pattern as PR #2508. The issue to track the integration test is #2510.

- Updated all module versions from 4.0.0-rc-4-SNAPSHOT to 4.0.0-SNAPSHOT
- Updated 41 pom.xml files including root and all submodules
- Fixed MavenITmng3991ValidDependencyScopeTest by changing version range from [4.0,) to [5.0,)
- This disables the test for Maven 4.x due to behavior change where invalid dependency scopes generate warnings instead of errors
- Maintains backward compatibility with extensions using custom scopes
@gnodet gnodet added this to the 4.0.0 milestone Jun 25, 2025
@gnodet gnodet added the chore label Jun 25, 2025
@gnodet gnodet self-assigned this Jun 25, 2025
@slawekjaranowski
Copy link
Member

so milestone 4.0.0 - https://github.com/apache/maven/milestone/31
should contain description:

branch: maven-4.0.x

@gnodet gnodet merged commit 14dd9f5 into apache:maven-4.0.x Jun 29, 2025
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