Apache Maven 4.0.0-rc-4 Release Notes

Apache Maven 4.0.0-rc-4 is available for download.

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

The core release is independent of plugin releases. Further releases of plugins will be made separately.

If you have any questions, please consult:

Maven 4.x

Maven 4.x is a major release that includes significant improvements and changes. Please refer to the Maven 4.x documentation for detailed information about new features and migration guidance.

Important Notes

  • This is a release candidate version intended for testing and feedback
  • Please report any issues to GitHub: https://github.com/apache/maven/issues
  • For production use, consider the stability and compatibility requirements of your project

Upgrading from Maven 3

Maven 4 introduces significant changes to enhance functionality and performance. While we’ve prioritized compatibility with Maven 3.x, some POM files may require updates to build successfully with Maven 4.

To identify and resolve common issues, use the Maven upgrade tool:

  • Run mvnup check to detect potential problems in your project.
  • Run mvnup apply to automatically apply recommended fixes.

If your build relies on Maven extensions not supported by the upgrade tool, contact the extension developers to confirm their plans for Maven 4 compatibility.

If your build still fails, run it with the -e option to generate a detailed stack trace. Then, file an issue including:

  • The full stack trace.
  • A link to the exact branch of your open-source project, or a minimal reproducer for proprietary projects.

Upgrading from Maven 4.0.0-rc-3

No known incompatibilities since last RC.

Changelog

Maven 4.0.0-rc-4 aims at being the last release candidate before Maven 4.0.0 GA. We'll focus on fixing critical bugs raised before GA. Worth mentioning is the new upgrade tool which can be used to fix your pom.xml files and make them usable in Maven 4.

🚀 New features and improvements

  • [MNG-8765] - Maven Upgrade Tool (#2407) @gnodet
  • Maven4 “legacy” mode and more (#2380) @cstamas
  • [MNG-8759] - Restore toString method in DefaultJavaToolchain (#2411) @slawekjaranowski
  • [MNG-8572] - Support DI beans in build extensions (#2274) @gnodet
  • [MNG-8717] - Remove maven-plugin-plugin:addPluginArtifactMetadata from default binding (#2294) @slawekjaranowski

🐛 Bug Fixes

  • Deduplicate filtered dependency graph (#2493) @alzimmermsft
  • User properties are not interpolated for paths (#2480) @cstamas
  • Move project mutation inside project lock (#2474) @cstamas
  • [MNG-8736 - Fix concurrency issue in model building with profile activation (#2378) @gnodet
  • [MNG-8767] - Add suppressed exceptions to BatchRequestException in AbstractRequestCache (#2431) @gnodet
  • [MNG-8746] - Preserve property insertion order in WrapperProperties (#2404) @gnodet
  • [MNG-8764] - Sort injected lists by @Priority annotation (#2425) @gnodet
  • [MNG-8761] - Add Maven 3 MavenToolchainsXpp3Reader/Writer (#2412) @slawekjaranowski
  • [MNG-8729] - Use correct outputStream destination; request instead of path in DefaultPluginXmlFactory#write (#2312) @Pankraz76
  • [MNG-8720] - Fix for symlinked project directory (#2289) @cstamas
  • [MNG-8653] - Fix ‘all’ phase and add ‘each’ phase (#2191) @gnodet
  • [MNG-5668] - Execute after:* phases when build fails (#2195) @gnodet
  • [MNG-8629] - bugfix: If POM has parent and repository stanza, it is used un-interpolated (#2192) @cstamas
  • [MNG-8645] - Fix dependency management section of consumer POM (#2183) @gnodet
  • [MNG-8624] - Fix dependency not being set correctly for unsupported types (#2153) @gnodet
  • Fix ITs referencing rc-3-SNAPSHOT (#2164) @gnodet
  • [MNG-8620] - Fix links in SVG (#2152) @kwin

📝 Documentation updates

  • [MNG-8731] - Use https for xsi:schemaLocation in generated descriptors (#2341) @slawekjaranowski

👻 Maintenance

  • Fix integration tests to use correct Maven version instead of hardcoded 2.1-SNAPSHOT (#2476) @gnodet
  • Use local repository in tests (#2485) @slawekjaranowski
  • Refactor WrapperProperties template to remove caching and simplify implementation (#2436) @gnodet
  • Ban “plain” Guice; downgrade it to 5.1.0 (#2472) @cstamas
  • Unfurl CLI (#2465) @cstamas
  • Don't ignore SVG files (#2435) @elharo
  • Update CONTRIBUTING after GitHub issues enabled (#2448) @slawekjaranowski
  • Remove extra variable (#2398) @elharo
  • Enable Github Issues (#2413) @Bukama
  • [S1161] Add missing @Override to overriding and implementing methods (#2402) @Pankraz76
  • use try-with-resources statement in LookupWagonMojo (#2426) @Pankraz76
  • Add UT for cache in FilteredProjectDependencyGraphTest (#2394) @slawekjaranowski
  • [MNG-8764] - centralize domain comparison logic Binding#getPriorityComparator (#2428) @Pankraz76
  • evolve Disabled to DisabledOnOs(WINDOWS) (#2423) @Pankraz76
  • use try-with-resources statement in CatchMojo (#2424) @Pankraz76
  • chore: resolve unused Binding#getDisplayString (#2429) @Pankraz76
  • Remove ignored method call (#2399) @elharo
  • [MNG-8750] - Delete unused interface (#2388) @elharo
  • chore: resolve false negative suppression @SuppressWarnings("checkstyle:UnusedLocalVariable") (#2369) @Pankraz76
  • [chore] Modernize codebase with Java improvements - Replace custom null checks with Objects.requireNonNull (#2290) @Pankraz76
  • Symbolic change (no issue) (#2383) @cstamas
  • [MNG-8713] - SourceRoot.directory() default value should include the module when present (#2278) @desruisseaux
  • [MNG-8727] - Prepare for Java 24 (#2328) @cstamas
  • [MNG-8686] - Add SourceRoot.matcher(boolean) method (#2236) @desruisseaux
  • Remove unused private methods (#2310) @Pankraz76
  • Improve invoker test (#2308) @cstamas
  • Pull #2282: Add project icon for IntelliJ IDEA (#2283) @Pankraz76
  • [MNG-8718] - Restore Maven 3 compat: ProjectBuilder is unusable for legacy code (#2285) @cstamas
  • Test MavenITmng7587Jsr330 should be executed on every JDK (#2298) @slawekjaranowski
  • [MNG-8719] - Restore Maven3 compat: model setInherited(boolean) (#2288) @cstamas
  • [MNG-8614] - Maven Sisu in Maven 4 same as in Maven 3 (#2284) @cstamas
  • [MNG-8712] - dependency version is a requirement, not effective (#2286) @hboutemy
  • [MNG-8670] - Fix concurrent builder missing/wrong project events (#2251) @oehme
  • [MNG-8674] - Deprecate mergeId in the Maven 3 model and remove it in the new model (#2233) @gnodet
  • [MNG-8694] - Fix version interpolation and ternary operator (#2272) @kamilkrzywanski
  • MNGSITE-393(https://issues.apache.org/jira/browse/MNGSITE-393) - Remove Maven 1 and 2 references (#2276) @elharo
  • Remove unneeded toString and valueOf calls (#2230) @elharo
  • Drop unused assembly exclude (#2266) @cstamas
  • aether repository system isn't used (#2237) @elharo
  • remove unused field (#2238) @elharo
  • Cleanup extra semicolons (#2229) @elharo
  • [MNG-8676] - Improve model builder error messages (#2257) @cstamas
  • Avoid warning about unthrown exception (#2217) @elharo
  • [MNG-8687] - Restore ability to run on JIMFS (#2256) @cstamas
  • [MNG-8673] - SourceRoot includes and excludes should be String (#2232) @gnodet
  • [MNG-8675] - Correctly deprecate Resource in the model (#2234) @gnodet
  • [MNG-8685] - Better support for CI systems (#2254) @cstamas
  • Add types for processor annotation path (#2239) @desruisseaux
  • [MNG-8679] - Align superpom with mvn3 (#2246) @cstamas
  • Avoid exposing non-public type outside its scope (#2220) @elharo
  • Grammar and typo fixes in javadoc and other comments (#2222) @elharo
  • Remove methods that duplicate superclass methods (#2211) @elharo
  • [MNG-8637] - Pull out Standalone API from UTs (#2226) @gnodet
  • MRESOLVER-673(https://issues.apache.org/jira/browse/MRESOLVER-673) - Improve model validator error messages (#2227) @cstamas
  • [MNG-8660] - Decouple legacy prompter from implementation details (#2196) @oehme
  • Add missing Javadoc to API subprojects (#2218) @gnodet
  • prefer primitive type (#2216) @elharo
  • autobox (#2223) @elharo
  • No catch block needed when rethrowing same exception (#2210) @elharo
  • [MNG-3558] - Ensure properties can be escaped (#2206) @gnodet
  • [MNG-8669] - Add missing context (#2224) @cstamas
  • [MNG-8662] - Add missing methods for removing project source roots (#2205) @gnodet
  • [MNG-4559] - Support spaces in jvm.config (#2213) @gnodet
  • prefer isEmpty (#2215) @elharo
  • [CI] Disable Mimir JGroups node (#2212) @cstamas
  • Access static fields in a static way (#2209) @elharo
  • Make maven-cli module tests use Mimir as well (#2207) @cstamas
  • Remove a few thousand lines of commented and obsolete code (#2200) @elharo
  • minor cleanups (#2199) @elharo
  • [MNG-8467] - Add links to configuration pages in index.xml (#2201) @gnodet
  • Add missing headers (#2202) @gnodet
  • [MNG-8598] - Add support for MAVEN_PROJECTBASEDIR substitution in jvm.config (#2194) @gnodet
  • [MNG-8548] - Add cycle detection to dependency injection (#2197) @gnodet
  • Remove some unnecessary statements (#2190) @elharo
  • Add test to suite (#2198) @gnodet
  • [MNG-8642] - Integrate the testing framework inside Maven Core (#2193) @gnodet
  • [MNG-8648] - Concurrent executor fires wrong ProjectStarted event (#2189) @oehme
  • [MNG-8647] - Set the default source directory to src/${scope}/${lang} as per documentation (#2180) @desruisseaux
  • [MNG-8646] - Make IT tests use “outer” Mimir caching as well (#2176) @cstamas
  • Remove redundant code (#2188) @elharo
  • Expected argument comes first in JUnit (#2187) @elharo
  • Reenable many old style tests (#2182) @elharo
  • [MNG-8490] - Add an XmlService and a builder + implementation for XmlNode (#2150) @gnodet
  • requireNonNull (#2181) @elharo
  • Remove old symbolic link in ITmng8400 test (#2178) @slawekjaranowski
  • [MNG-8612] - Document Node#asString and remove Version#asString and VersionConstraint#asString (#2172) @gnodet
  • [MNG-8510] - Avoid duplicate Utils classes (#2173) @gnodet
  • [MNG-8639] - Check namespaces when reading XML models (#2170) @gnodet
  • [MNG-8511] - Explains the meaning of cling (#2174) @gnodet
  • [IT] Refactor executor (#2175) @cstamas
  • [MNG-8633] - Initialize entities map lazily (#2165) @gnodet
  • Replace a NullPointerException by a more explicit error message (#2160) @desruisseaux
  • Restore Jenkins build for master (#2151) @olamy
  • [experiment] Mimir (#2144) @cstamas
  • [[MNG-8615] [MNG-8616]](https://issues.apache.org/jira/browse/MNG-8615] [MNG-8616) - Maven core extensions handling improvements (#2147) @cstamas
  • Minor Javadoc cleanup (#2126) @elharo
  • [MNG-8613] - Copy edit dependency javadocs (#2143) @elharo

🔧 Build

  • Improve configuration for dependabot in 3.x branch (#2447) @slawekjaranowski
  • Remove branch after merge (#2323) @slawekjaranowski

📦 Dependency updates

Full changelog

For a full list of changes, please refer to the GitHub release page.