Skip to content

Simplifications for the 3.x lines #13309

Description

@slachiewicz

Description

Porting the estate to the Maven 4 API (#13302) showed code on the current Maven 3 lines that is buggy, more complicated than it needs to be, or will make the later port harder. This issue tracks the changes that can land on the Maven 3 lines now: they behave the same on Maven 3, and each one shrinks or removes part of the future Maven 4 port. Every item comes from a finished port; its findings are on #13302.

Kinds: bug (found by a port, fix it now), cleanup (behaviour-neutral, smaller port later), deprecation (announce now what Maven 4 removes, so users get a release of warning), seam (a small internal refactor so the port only swaps one method body).

Status

✅ merged · 🔄 pull request open · ⬜ not started (updated 2026-10-07)

The agent/mvn4-api branches rebased on 2026-10-06 include the Done items for maven-acr-plugin, maven-dependency-plugin, maven-enforcer, maven-gpg-plugin and maven-reporting-exec; their findings are on #13302.

Done

24 items
Repository Kind Change Link
✅ maven-doxia-sitetools seam Resolve each site descriptor locale through one helper apache/maven-doxia-sitetools#703
✅ maven-doxia-sitetools seam Request skin and site descriptor artifacts from Resolver directly apache/maven-doxia-sitetools#704
✅ maven-doxia-sitetools seam Match skin prerequisites with Resolver's generic version scheme apache/maven-doxia-sitetools#706
✅ maven-doxia-sitetools cleanup Run SiteToolTest offline from a seeded local repository apache/maven-doxia-sitetools#702
✅ maven-reporting-impl cleanup Replace the deprecated API used in AbstractMavenReport apache/maven-reporting-impl#251
✅ plexus-archiver bug Archivers created without a container can unpack (ServiceLoaderArchiverManager) codehaus-plexus/plexus-archiver#500
✅ maven-dependency-tree cleanup Planned-retirement notice: the Maven 4 port showed it is mostly redundant with Resolver apache/maven-dependency-tree#151
✅ maven-common-artifact-filters bug ArtifactTransitivityFilter.transitiveArtifacts is never initialised, so its constructor throws NullPointerException on the first resolved dependency apache/maven-common-artifact-filters#131
✅ maven-resolver-ant-tasks bug AntRepoSys.getSettings() throws NullPointerException when settings.xml cannot be read apache/maven-resolver-ant-tasks#196
✅ maven-release bug The forked build's release-settings*.xml is written with FileWriter, in the platform charset, under a UTF-8 header apache/maven-release#1514
✅ maven-archetype bug DefaultPomManager merges dependencies in HashMap order apache/maven-archetype#1042
✅ maven-reporting-exec bug setReportPlugins shares the model's report list instead of copying it apache/maven-reporting-exec#168
✅ maven-changelog-plugin, maven-toolchains-plugin cleanup @Component → @Inject apache/maven-changelog-plugin#252, apache/maven-toolchains-plugin#202
✅ maven-ejb-plugin, maven-rar-plugin cleanup Unit tests on JUnit 5 without AbstractMojoTestCase apache/maven-ejb-plugin#242, apache/maven-rar-plugin#182
✅ maven-rar-plugin cleanup An IT with real dependencies: no IT had one, so a port that copied nothing stayed green apache/maven-rar-plugin#181
✅ several (acr, ejb, rar, enforcer, release, archetype) cleanup plexus-utils → JDK or commons-lang3 where the semantics are identical apache/maven-acr-plugin#156, apache/maven-ejb-plugin#241, apache/maven-rar-plugin#180, apache/maven-enforcer#1048, apache/maven-release#1516, apache/maven-archetype#1043
✅ maven-acr-plugin bug The user's excludes list is changed in place apache/maven-acr-plugin#155
✅ maven-acr-plugin seam Register the app-client artifact handler and lifecycle mapping as Sisu-indexed classes instead of Plexus components.xml, as maven-rar-plugin does apache/maven-acr-plugin#157
✅ maven-acr-plugin, maven-rar-plugin bug A project that loads the plugin through <build><extensions> runs the latest released packaging goal instead of the loaded one apache/maven-acr-plugin#157, apache/maven-rar-plugin#183
✅ maven-dependency-plugin, maven-project-info-reports-plugin cleanup Replace maven-dependency-tree with Maven Resolver apache/maven-dependency-plugin#1712, apache/maven-project-info-reports-plugin#670
✅ maven-enforcer bug EnforcerRuleUtils.resolvePlugins changes the effective model's Plugin objects in place apache/maven-enforcer#1046
✅ maven-enforcer deprecation Make the existing warning for EnforcerRule, EnforcerRule2 and EnforcerRuleHelper name enforcer 4.0.0 as the removal point apache/maven-enforcer#1047
✅ maven-jmod-plugin, maven-jdeprscan-plugin cleanup Drop the reflection around ToolchainManager.getToolchains, which the interface has apache/maven-jmod-plugin#121, apache/maven-jdeprscan-plugin#94
✅ maven-gpg-plugin deprecation settings parameter in favour of the session's settings apache/maven-gpg-plugin#346

In progress

Repository Kind Change Link
🔄 maven-toolchains-plugin bug Toolchain discovery returns nothing when one JDK cannot be read, instead of skipping that JDK apache/maven-toolchains-plugin#196 (issue apache/maven-toolchains-plugin#191)
🔄 maven-mapping deprecation Document only the file-name tokens that survive; ArtifactHandler tokens such as @{packaging}@ stop resolving on Maven 4 apache/maven-war-plugin#666, apache/maven-ear-plugin#569
🔄 maven-doxia-sitetools deprecation Artifact-based skin methods in SiteRenderer and SiteRenderingContext, with File/Path overloads apache/maven-doxia-sitetools#707
🔄 maven-reporting-impl, maven-rar-plugin cleanup ${basedir} → ${project.basedir} in parameter defaults of mojos that require a project apache/maven-reporting-impl#255, apache/maven-rar-plugin#179
🔄 maven-jdeps-plugin cleanup Drop the reflection around ToolchainManager.getToolchains, which the interface has apache/maven-jdeps-plugin#109
🔄 maven-release deprecation DefaultReleaseManagerListener(Log) in favour of slf4j overloads apache/maven-release#1515
🔄 maven-reporting-impl deprecation Protected fields reactorProjects, repoSession, remoteProjectRepositories, siteTool, siteRenderer in favour of getters; five report plugins read them directly apache/maven-reporting-impl#256
🔄 maven-plugin-tools deprecation PluginToolsRequest.get/setRepoSession, PluginHelpGenerator.setVelocityComponent apache/maven-plugin-tools#1223, apache/maven-plugin-tools#1224 (3.x)
🔄 maven-surefire cleanup Create plexus-java's LocationManager with new instead of injecting it apache/maven-surefire#3499
🔄 maven-jarsigner-plugin deprecation settings field in favour of the session's settings apache/maven-jarsigner-plugin#176
🔄 maven-archetype cleanup Replace plexus-velocity's VelocityComponent with a plain VelocityEngine apache/maven-archetype#1044
🔄 maven-plugin-tools cleanup Unpack sources jars with java.util.zip instead of plexus-archiver's ArchiverManager apache/maven-plugin-tools#1225, apache/maven-plugin-tools#1226 (3.x)
🔄 maven-reporting-exec seam coreSession(request) / coreProject(request) helpers apache/maven-reporting-exec#169
🔄 maven-scm-publish-plugin seam Inline getConfiguredRepository with an injected SettingsDecrypter and drop maven-release-manager apache/maven-scm-publish-plugin#167
🔄 maven-enforcer, maven-release seam One helper per repository for the original model and project file apache/maven-enforcer#1049, apache/maven-release#1517
🔄 maven-release seam Pom* view interfaces over the DomTrip classes apache/maven-release#1518
🔄 maven-dependency-analyzer seam Collect dependencies directly instead of the DependencyGraphProject extends MavenProject workaround apache/maven-dependency-analyzer#306
🔄 maven-indexer seam Replace ArtifactContext.getPomModel() with a small value type (name, description, packaging); indexer-core then drops maven-model and needs no Maven 4 port apache/maven-indexer#808

To do

Repository Kind Change
⬜ maven-plugin-tools cleanup Replace plexus-velocity's VelocityComponent with a plain VelocityEngine in HelpGeneratorMojo, after apache/maven-plugin-tools#1223
⬜ maven-doxia bug MarkdownHtmlParser is registered as a Parser through its bare @Named, so every parser map lists it next to the real formats (apache/maven-doxia#1111)

Not now

These wait for an API request on #13302 and must not be deprecated before a replacement exists: maven-common-artifact-filters actTransitively; maven-dependency-tree premanaged getters and collector setters; enforcer rules requireUpperBoundDeps, banDynamicVersions and requireProfileIdsExist.

Dropped: building an ScmManager (apache/maven-scm#1418), the Doxia parser managers (apache/maven-doxia#1110) and a CompilerManager (codehaus-plexus/plexus-compiler#524) without Sisu through ServiceLoader. Once Maven 4 API mojos can inject Sisu components from their plugin realm through javax.inject (#13326, planned for 4.0.0-rc-8), the ports inject these managers as they do on Maven 3.

Also dropped: a maven-archetype helper for the project reads in FilesetArchetypeCreator. The Maven 4 port rewrites that class for immutable models anyway, so a helper would not make the port smaller.

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions