Repository navigation
Description
Description
An impact study, not a migration: on 2026-09-30 the Apache Maven components and plugins were ported from the Maven 3 API (MavenProject, org.apache.maven.artifact, maven-compat, Sisu and Plexus components) to the Maven 4 API at 4.0.0-rc-7, to measure what ports cleanly, where the Maven 4 API has no equivalent, and which components are better kept on Maven 3 than ported.
The study was closed as not planned on 2026-10-07: Maven 4.0.0 is not released, and a second line per component would double the maintenance. No port was merged. It was reopened on 2026-11-14 to keep the findings current: the ports were rebased, the gaps were rechecked, and what came out of it is tracked in #14000 and #14001. This description was revised on 2026-11-14 to say where each finding stands now, after the ports were rebased and run against a build of master.
How to read it:
- Component results are measurements from 2026-09-30 at rc-7 and were not re-run. The ports are branches named
agent/mvn4-apiin theslachiewiczforks of each repository; the state of 2026-10-06 is kept there asagent/mvn4-api-20261006. On 2026-11-14 all 50 were rebased onto their default branches; the ports of maven-dependency-plugin, maven-shade-plugin and maven-remote-resources-plugin needed upstream's changes ported one commit at a time (see "Carrying cost"). The 19 study pull requests are closed unmerged; two CI fixes that came with them were merged. The comments below are the record of that date and are not updated. - The gap tables were rechecked against the code on 2026-11-14, on
maven-4.0.x(35b8736) andmaster(6145dae).maven-4.0.xis what 4.0.0 will ship: its API modules differ from rc-7 by fewer than 200 changed lines.masteris 4.2.0-SNAPSHOT and carries the new API. A gap closed onmasteronly is not closed for a plugin that targets 4.0.x, and every API type added onmasteris still@Experimental. - The design work moved to other issues: Migrate Maven internals from v3 to v4 API (tracking issue)Β #13460 (migrate Maven's internals to the Maven 4 API, with the Maven 3 types kept as wrappers until Maven 5), v4 API/SPI gaps for build extensions β analysis from TychoΒ #13499 (API and SPI gaps for build extensions and IDE embedders, from Tycho and m2e), Support pure maven-di build extensions (pave the way for Maven 5)Β #13989 (build extensions on Maven DI alone), Overall plan for classloader improvements in Maven 4.1Β #13223 (class loading), Define v4 Maven execution service API for embedded useΒ #13472 (an execution service for embedded use) and Deprecate aggregator=true and @Execute in favor of phase-based DAG orderingΒ #13762 (replace
aggregatorand@Executewith phase ordering).
Where the gaps stand
Closed on both branches
| Gap at rc-7 | Fixed by |
|---|---|
PackagingProvider ignored by the packaging registry (#13306, reopened and still open) |
maven-4.0.x: #13550, the backport of #13319. master: #13319 was reverted by #13574 and redone in #13570, which also filters providers by class-loader visibility. Core IT gh-13306 on both branches |
MojoExecution.getPlugin().getDependencies() throws when the plugin realm comes from the cache (#13307) |
#13312 |
Maven DI cannot inject an empty List or Map |
#13878, backport #13879 |
Closed on master only
| Gap at rc-7 | Fixed by | Still missing |
|---|---|---|
An XmlNode mojo parameter loses its XML attributes (#13305) |
#13636 replaced the Plexus configurator; the node is passed through unchanged (#13528) | PlexusConfiguration parameters remain unsupported; XmlNode is the replacement |
No conflict data on Node |
#13485: winner(), premanagedVersion(), premanagedScope(), originalScope() (#13151, still open) |
A parent link, a dependency trail (Maven 3 Artifact.getDependencyTrail(), now used by maven-dependency-analyzer) and the declared version constraint |
No request data on Session: -ff/-fae/-fn, requested -P profiles, -pl, -rf, threads |
#13542: Session.buildInvocation() |
-e, and the settings and toolchains file locations |
Partly closed, on master only
| Gap at rc-7 | What master has |
What is still missing |
|---|---|---|
| No plugin manager: nothing resolves, configures or runs another plugin's mojo, so a Maven 4 site plugin cannot run reports | PluginManager.loadPlugin (#13625) returns a plugin's descriptor, dependencies and realm with a Lookup; LifecycleExecutor (#13612) plans and executes a project's lifecycle, with a filter |
A configured mojo instance that is not executed: a site plugin calls generate on the report, it does not run the goal. Tracked in #13518. loadPlugin accepts build plugins only, not the ones under <reporting> |
| No SPI to skip or replace a mojo execution, and no lifecycle participant | ProjectTransformer (#13808) replaces afterProjectsRead; ExecutionListener, and Listener discovered as an SPI service (#13701); LifecycleProcessor; a static filter, maven.lifecycle.filter (#13392) |
A decision taken at execution time with access to the build state, which is what the build cache needs: #13987. Per-project callbacks: #13807 |
plugin-tools writes no <resolutions>, does not extract dependencyResolutionPathScopes, and fails on dependencyCollection |
Maven has its own descriptor generator, maven-plugin-mixin (#13644, #13658), an annotation processor that writes all three |
maven-plugin-tools, whose latest release is still 4.0.0-beta-3, has open issues with open fixes: apache/maven-plugin-tools#1230 (<resolutions>, fix in apache/maven-plugin-tools#1234), apache/maven-plugin-tools#1231 (dependencyCollection and path scopes, apache/maven-plugin-tools#1237), apache/maven-plugin-tools#1232 (@Execute with a custom phase, apache/maven-plugin-tools#1235). apache/maven-plugin-tools#1229 (constructor injection) is open |
Legacy BuildContext forces org.eclipse.sisu.plexus at compile scope |
Nothing merged | #12576 was closed; #13983 replaces it with an incremental build context, and apache/maven-filtering#363 is the experiment on it |
Open, with a design issue
| Gap | Issue |
|---|---|
No public Session outside a Maven runtime. ApiRunner is still internal to maven-impl, though it is now used and fixed as if it were public (#13655, #13469, #13835) |
#13472 |
A Maven 4 API mojo cannot inject a Sisu or Plexus component from its plugin realm (ScmManager, ArchiverManager, the Doxia managers, Wagon). loadV4Mojo still builds a standalone injector |
#13326 and its fix #13327 are closed. The direction is the opposite one: #13989 prepares build extensions for a Maven 5 without Sisu |
Project has no resolved-artifact view and no project references |
#13460 puts resolved dependencies and attached artifacts on Project; #13463 defines the project graph |
| Mojo configuration cannot be read without running the mojo | #13518 |
No forked-lifecycle API; @Execute(phase = "none") crashes the descriptor generator |
#13762 deprecates @Execute and aggregator in favour of @After and the after: phases; #13763 already maps aggregator in the concurrent builder; the migration guide is #13764 |
| A plugin or extension cannot ask for a core package in its realm, or share types with another plugin | #13223 |
No API to start a process; maven-shared-utils JavaTool reaches the toolchain by reflection and silently runs the Maven JDK on Maven 4 |
#13895 |
org.apache.maven.api.di.MojoExecutionScoped is unusable, and the mojo execution scope does not reach threads a plugin starts |
#13839, #13827 |
Open, no issue found
Rechecked in the code on both branches, unchanged. A search of the open issues and pull requests of apache/maven on 2026-11-14 found nothing that closes them; the rows name what is related. They are now collected in #14001, except the rows on Session.getProject, JavaPathType and DependencyCoordinatesFactory.
| Gap | Hit in |
|---|---|
| No settings encryption or decryption API for a plugin | release, gpg, jarsigner |
No original (pre-interpolation) model on Project |
release, enforcer |
No metadata resolution service (master has a RepositoryMetadata type and repository events, but nothing resolves metadata); RemoteRepository has no policies; no artifact-descriptor service, so relocation is re-implemented |
archetype, resolver-ant-tasks, dependency, doap |
Transport has no existence check |
doap |
Session.getProject returns nothing for a project without a base directory, so Project.getParent() is empty for a parent from a repository and ProjectBuilder returns an empty result for a Source. This is also half of what blocks maven-project-info-reports-plugin. Related but not a fix: #13538, #13669 |
site, doap, invoker, project-info-reports |
JavaPathType classifies each dependency alone; addOutputDirectory is still marked as not called. Related: #9065 |
jmod |
Mojo expressions resolve objects under session., project., mojo. and settings. only: no ${plugin.*} |
surefire, scm-publish, changelog |
ToolchainFactory is not a Service, so a plugin cannot inject one to turn a ToolchainModel into a Toolchain |
toolchains |
DependencyCoordinatesFactory.create(Session, model.Dependency) drops scope, optional and exclusions; master has new overloads that take them, but this one is unchanged |
shade |
Not rechecked
Stated at rc-7 and not looked at again; each needs a reproducer before it is acted on.
- Resolution ignores
includesDependenciesofwar,earandrar, and lists an artifact reached by several paths only under its nearest parent (ear). Doubtful as worded:FatArtifactTraverserinmaven-implread that property at rc-7 already. - No timestamped snapshot version on a resolved artifact (ear).
Session.withLocalRepositorycannot override the split local repository layout; no settings merge; no view of the plugin's own artifacts (invoker).- No remote-layout service (doap).
- Resolved dependencies come level by level rather than in tree order (dependency).
- No version resolution for plugins, report plugins and extensions (release).
VersionResolverexisted at rc-7 and takes any artifact coordinates, so what was missing is narrower than stated. - No way to configure conflict resolution or scope selection for a verbose collection (dependency-tree).
DependencyResolverRequest.getVerbose()existed at rc-7. - A
ToolchainFactorycontributed by an extension is found only through the Sisu index (toolchains). - No factory for
Dependency,TypeorVersionwithout aSession(dependency-tree, mapping, surefire). - Configuration cannot populate model types, and the strict reader rejects
<reports>and plugin<goals>(surefire, archetype). - A plugin cannot replace the project's POM file (shade). [Backport master] Fix DefaultArtifactManager.getPath() to honor explicitly-set paths over project artifact fileΒ #13543 changed how an explicitly set artifact path is honoured; [MNG-8072] Add a consumerPomFile to the MavenProjectΒ #10863 asks for a
consumerPomFileon the Maven 3MavenProject; Maven 4 consumer and build-pom file conflictΒ maven-shade-plugin#864 is open for the conflict with the consumer POM, with a file-level fix in [#864] Fix Maven 4 shaded consumer POMΒ maven-shade-plugin#865. - A model without
<name>gives a null name where Maven 3 fell back to the artifactId (site, doap). Two ports needed the fallback, so it is not only a doxia-sitetools matter.
Found while rebasing
Upstream changes made since October that the ports could not carry. Checked on maven-4.0.x and master on 2026-11-14; four are in #14001 and one is a bug, #14004.
| Gap | Where it stands |
|---|---|
A custom DependencySelector for one resolution; DependencyResolverRequest takes a PathScope only (dependency) |
Holds on both, by design: the compile and test path scopes resolve conflicts over the whole graph before filtering scopes. In #14001 |
The source of a mojo execution: Maven 3 MojoExecution.getSource() (dependency) |
Holds on both. On master the Javadoc says executionId() is empty for a command line goal; the implementation returns default-cli. In #14001 |
| Pattern filters that match the file extension as well as the type (dependency) | Wrongly stated: Dependency has both. The extension is lost in maven-common-artifact-filters, whose resolve.Node hands out a model Dependency |
| The local path of a system-scope artifact (dependency) | Wider than stated: DependencyResolver drops system-scope dependencies, and maven-compiler-plugin 4.0.0-beta-5 cannot compile against one. Bug #14004 |
Excluding a file from a project resource: Maven 3 Resource.addExclude (remote-resources) |
Holds on both: SourceRoot is read-only and cannot be replaced. In #14001 |
Whether a type is added to the class path: Maven 3 ArtifactHandler.isAddedToClasspath() (shade) |
Wrongly stated: Maven derives it as Type.getPathTypes().contains(JavaPathType.CLASSES) |
| Strict reading of a Maven 3 model (remote-resources) | Holds on both: the strict reader rejects <reports> and <goals>, which model version 4.0.0 declares. In #14001 |
Withdrawn
These were listed as API gaps at rc-7 and should not have been.
| Claim | Correction |
|---|---|
Session has no build start time |
ProtoSession.getStartTime() existed at rc-7, and Session extends ProtoSession |
| No public test fixtures | maven-testing shipped ProjectStub, SessionMock, MojoExtension and @InjectMojo at rc-7. Defects found in it later are fixed (#13810 to #13813, #13928) |
No ArtifactHandler equivalent |
Type carries the id, language, extension, classifier, includesDependencies and path types. What disappeared are the reflective file-name tokens of maven-mapping, which is a property of that library |
The mojo-descriptor model lacks threadSafe, instantiationStrategy, executionStrategy, requiresReports and requirements |
They are in plugin.mdo, for descriptor versions 1.0.0 and 1.1.0; version 2.0.0 does not have them. The consequence is narrower than stated: maven-plugin-tools cannot use the API model as its internal model for Maven 3 descriptors |
Model builders do not clear a value set to null |
How the generated builders work: null keeps the value of the base object; Model.newBuilder(model, true) or withParent(null) clears it. A trap, not a gap |
A bare @Named is the empty key, not default |
A difference from Sisu to document for plugin authors, not a defect |
Session.resolveArtifact no longer fetches the POM or follows relocation |
It is a shortcut for ArtifactResolver.resolve. The Maven 3 code read the artifact descriptor, and the gap is the missing descriptor service, listed above |
No path from Session or Project to MavenProject or RepositorySystemSession |
#13460 keeps the Maven 3 types for Maven 3 plugins as wrappers; a Maven 4 mojo is not meant to get them |
From 4.0 to 4.2
The rebased ports, built against rc-7, were run on a build of master (6145dae) and then compiled against its API. On the master runtime they behave as on rc-7: 32 of 38 are green on both, with the same unit-test counts. Compiled against the 4.2.0-SNAPSHOT API, 14 of 31 are green and 13 fail because of an API change. Integration tests were then run for four ports. Built for 4.0, the antrun and checkstyle ports fail on master with NoSuchMethodError on MojoExecution.getConfiguration() (#14000). The antrun port compiled against 4.2 without its XmlNode workaround passes all 29 ITs on master, and 6 of 29 on rc-7, so #13636 fixes the attribute loss in a real plugin. The acr and rar ports do not use PackagingProvider, so their ITs say nothing about #13306.
Change on master |
Effect on code built for 4.0 | Ports affected |
|---|---|---|
MojoExecution has plugin(), configuration(), goal() and so on; maven-4.0.x has only getPlugin(), getConfiguration(), getGoal(). Neither line has the other's names |
Does not compile, and a plugin built for 4.0 fails on 4.2 with NoSuchMethodError: #14000 |
antrun, checkstyle, ear, enforcer, reporting-impl |
The noun-style accessors of Artifact, Dependency, Project are abstract, with the get names as deprecated defaults (#13036, #13830) |
Callers compile with warnings; every implementation outside Maven stops compiling | test stubs in mapping, common-artifact-filters, plugin-tools, release, sitetools; main code in dependency-analyzer |
org.apache.maven.api.services.model.PathTranslator is gone from the SPI |
maven-plugin-testing-harness 4.0.0-beta-4 fails with NoClassDefFoundError |
changes, changelog |
The org.apache.maven.api.di.testing and org.apache.maven.api.plugin.testing packages are gone from maven-testing |
Tests do not compile | shared-jar |
ModelResolver.ModelResolverRequest constructor changed |
Does not compile | resolver-ant-tasks |
The deprecated accessors most used by the ports are Artifact.getGroupId() and Project.getBasedir() (13 ports each) and Project.getModel() and Project.getVersion() (12 each).
In estate tooling and libraries
| Gap | State on 2026-11-14 |
|---|---|
ScmManager, the Doxia parser managers and a CompilerManager can be built only through Sisu |
The ServiceLoader factories were dropped (apache/maven-scm#1418, apache/maven-doxia#1110, codehaus-plexus/plexus-compiler#524) because #13326 was to make them unnecessary. #13326 is closed, so the question is open again; see #13989. For Doxia, apache/maven-doxia-sitetools#736 proposes passing parsers their context instead of injecting Maven objects |
| plexus-archiver archivers created without a container fail when unpacking | codehaus-plexus/plexus-archiver#500 is merged on its master (5.0.0-SNAPSHOT); 4.15.0 does not contain it |
plexus-velocity VelocityComponent in maven-archetype |
apache/maven-archetype#1044, merged |
Report mojos: maven-site-plugin 3.x accepts only Maven 3 mojos as reports, and plugin-tools writes <requirements> inherited from AbstractMavenReport into a 2.0.0 descriptor, which Maven rejects for every goal of the plugin |
Unchanged. Reporting still has to move as a chain, and the chain waits for #13518 |
<proc>none</proc> in the parent POMs: the Maven DI index is written by hand |
Not rechecked |
| Dependency-reduced POM of a shaded build rejected by Maven 4 | apache/maven-shade-plugin#813, closed as completed |
spotless-maven-plugin @Component warning on Maven 4 |
diffplug/spotless#3122, released in 3.10.4 |
Findings, revised
- Timing. Migrate Maven internals from v3 to v4 API (tracking issue)Β #13460 keeps
MavenProject,MavenSession,AbstractMojoand the Maven 3 model as supported wrappers until Maven 5. A Maven 3 API plugin keeps working on Maven 4, so a port buys a plugin nothing until it needs something only the Maven 4 API offers. - Branch. Most of what closed since rc-7 closed on
masteronly, so a port against 4.0.x re-implements what 4.2 provides. But a port built for 4.0 does not carry over: 13 of the 31 ports that could be compiled against the 4.2 API fail on an API change, andMojoExecutionhas no accessor name common to both lines (MojoExecution accessors differ between maven-4.0.x and master, so a plugin built for 4.0 fails on 4.2 with NoSuchMethodErrorΒ #14000). - Carrying cost. Six weeks after the last rebase every port branch was behind its default branch, by 6 to 109 commits, and a plain rebase conflicted in 44 of 50. Three ports (dependency, shade, remote-resources) could be brought forward only by porting upstream's changes one commit at a time; in maven-dependency-plugin that meant 76 commits touching ported files, and 405 upstream tests on the Maven 3 harness are now excluded, up from 265. The breakage came mostly from upstream's new tests, which are written against
MavenProjectstubs and merge without conflict, then fail to compile; in maven-archetype a merge without conflict brought back a bug that upstream had fixed in a method the port had rewritten. - Port order. The ports depend on each other through unreleased snapshots: maven-common-artifact-filters blocks javadoc, surefire and assembly, and the reporting ports block invoker and changelog.
- Compatibility. A ported mojo still cannot run on Maven 3: the
Mojocontract and the injector differ. The reverse works for single services: [maven-3.10.x] Replace the 3.10 MessageBuilderFactory with the Maven 4 APIΒ #13919 put the Maven 4MessageBuilderFactoryintomaven-3.10.x, so one plugin binary injects it on 3.10 and 4 (Make the Maven 4 MessageBuilderFactory available in Maven 3.9 and 3.10Β #13917; no 3.9 backport is merged). That is cheaper than a second line per plugin. - Reporting. Still the largest blocker. doxia-sitetools, maven-site-plugin, reporting-impl and reporting-exec must move together, and the site plugin needs a configured report instance (v4 API: Mojo configuration introspection without executionΒ #13518). Until then every report goal stays on the Maven 3 API; the non-report goals of the same plugins ported.
- Sisu libraries. maven-scm, plexus-archiver, Doxia and Wagon are Sisu components. With Maven 4 API mojos cannot inject Sisu components from their plugin realmΒ #13326 closed and Support pure maven-di build extensions (pave the way for Maven 5)Β #13989 open, a port either waits for those libraries or builds their components by hand, as the maven-scm-publish-plugin port did.
- Redesigns. A port is rarely a type swap. The immutable model forced redesigns (maven-release edits the POM as a DOM), and three enforcer rules were removed rather than silently weakened:
requireUpperBoundDeps,banDynamicVersionsandrequireProfileIdsExist. Onmasterthe first has the pre-managed version it lacked and the third hasbuildInvocation().activeProfiles();banDynamicVersionsstill has no declared version constraint onNode. None was re-tried. - Scope. Not every component should adopt Maven DI. indexer-core is used outside Maven; dropping its Maven dependency serves it better than a port.
- Tests. Green tests do not prove a port. A
@Resolutionfield that stayed null passed every maven-rar-plugin test until an IT with real dependencies was added, and maven-shade-plugin stayed green while publishing the original POM instead of the reduced one. - Maven 3 lines. What landed is Simplifications for the 3.x linesΒ #13309: 33 changes on the 3.x lines (23 bugs and cleanups, 10 deprecations and seams). A second pass over the port diffs on 2026-11-14 found little left that is independent of the Maven 4 API: four code changes and one set of integration tests, listed below. No JUnit 4 or maven-compat use remains to remove on the default branches of these repositories, apart from maven-surefire, where JUnit 4 is the product.
Filed from this work
| Item | Outcome |
|---|---|
#13305 XmlNode parameters lose attributes |
closed as not planned; fixed on master by #13636 |
#13306 PackagingProvider ignored |
fixed on both branches; issue still open |
| #13307 plugin dependencies throw on a cached realm | closed as not planned; fixed on both branches by #13312 |
| #13326 Sisu components in Maven 4 API mojos | closed with #13327 and #13328: the fix was proven only with a test-side import of javax.inject |
| #13309 simplifications for the 3.x lines | done, 33 changes; apache/maven-toolchains-plugin#196 was the last |
| #12709 minimum Maven baseline | closed as not planned; #13748 (raise the plugin prerequisite to Maven 3.9.0) is closed as completed |
| apache/maven-plugin-tools#1229 mojo constructor injection | open |
apache/maven-doxia#1111 MarkdownHtmlParser registered through a bare @Named |
closed |
| apache/maven-shared-resources#87, apache/maven-archiver#416, apache/maven-filtering#411, apache/maven-archetype#1044 | merged |
#13895 process execution service, #13917 Maven 4 MessageBuilderFactory on Maven 3, #13827 mojo execution scope and plugin threads |
opened later from the same line of work; open |
#14000 MojoExecution accessors differ between maven-4.0.x and master |
open |
| #14001 Maven 4 API gaps for plugin authors without an issue | open |
#14004 DependencyResolver drops system-scope dependencies |
open |
#14007 master's V4MojoConfigurator never assigns an object to a non-scalar parameter |
open |
| #14010 version range resolution reports a failed metadata download as "No versions matched" | open |
apache/maven-jlink-plugin#710 (call ToolchainManager.getToolchains directly), apache/maven-remote-resources-plugin#352 and apache/maven-help-plugin#462 (plexus-utils helpers replaced by JDK calls), apache/maven-dependency-plugin#1800 (inject the analyzers instead of the Plexus container), apache/maven-changes-plugin#692 (integration tests for goals that had none) |
merged |
Components
Results at rc-7 on 2026-09-30. After the rebase of 2026-11-14 the unit tests of 38 ports were run again on rc-7 and 32 are green; integration tests were not run again. Not green: assembly (needs snapshots of maven-archiver, maven-filtering and plexus-archiver that no longer exist), indexer, executor and checkstyle (do not build after the rebase), changelog (19 errors, as at rc-7), scm (one test). The javadoc, shade, remote-resources and dependency ports were not in that run; they were brought up to date afterwards and their unit tests pass. Counts are src/main files importing the Maven 3 API on the default branch at that date, excluding a plugin's own org.apache.maven.plugins.* packages; for the shared components the count is imports. For repositories that hold both a library and a plugin (surefire, release, enforcer, plugin-tools, archetype, scm, jxr, wrapper), only the library modules were counted and ported.
| Uses the Maven 3 API | of which ported | partial | blocked | Uses no Maven API | Already on the Maven 4 API |
|---|---|---|---|---|---|
| 45 | 22 | 19 | 4 | 16 | 12 |
Uses the Maven 3 API
| Component | Maven 3 API use | Study PR | Result at rc-7 |
|---|---|---|---|
| maven-acr-plugin | 1 | ported, green locally (4 ITs); app-client packaging still registered through a Sisu LifecycleMapping provider: rc-7 ignores PackagingProvider |
|
| maven-antrun-plugin | 7 | ported, green locally (4 unit, 29 ITs); Ant reference maven.project is now the v4 Project, maven.project.helper removed |
|
| maven-archetype | archetype-common 11 | partial: archetype-common ported; archetype plugin excluded, does not compile; remote catalog loses cache and update policy | |
| maven-artifact-plugin | 11 | partial: 25 unit tests; ITs 13 β 12 passed (buildinfo-dir: a pom project has no main artifact); check-buildplan approximated with no execution-plan service; reproducible-central report blocked by the reporting chain |
|
| maven-assembly-plugin | 21 | ported, green locally (271 unit, 156 ITs; the one failing IT is excluded from run-its by the POM); needs an unreleased plexus-archiver: its archivers cannot unpack without a container |
|
| maven-build-cache-extension | 31 | apache/maven-build-cache-extension#544, closed | blocked: no SPI to skip or replace a mojo execution (now #13987); no code change |
| maven-changelog-plugin | 3 | blocked: compiles, but maven-site-plugin 3.x cannot run a v4 report mojo (Cannot cast ChangeLogReportFactory to org.apache.maven.plugin.Mojo); ITs 4 of 4 β 0 of 4 |
|
| maven-changes-plugin | 28 | partial: the four non-report goals ported (54 unit tests, 16 ITs incl. 11 new); report goals excluded | |
| maven-checkstyle-plugin | 8 | partial: check ported (16 unit, 30 ITs; 4 ITs no longer run the report first); report goals blocked, 19 report ITs excluded; plexus-resources built without Sisu |
|
| maven-common-artifact-filters | 16 | apache/maven-common-artifact-filters#130, closed | ported, one feature removed (actTransitively) |
| maven-dependency-analyzer | 14 | apache/maven-dependency-analyzer#305, closed | ported |
| maven-dependency-plugin | 75 | partial: 25 of 29 goals ported (174 unit tests; about 265 Maven 3 harness tests excluded, not deleted); add, remove, list-repositories, analyze-report have no route; tree -Dverbose loses conflict data |
|
| maven-dependency-tree | 12 | apache/maven-dependency-tree#149, closed | ported, verbose detail reduced; retirement proposed in apache/maven-dependency-tree#150, closed as not planned |
| maven-doap-plugin | 3 | ported, green locally (15 unit, 4 ITs); five behavioural approximations: repository policies, metadata, existence checks | |
| maven-doxia-sitetools | 5 (integration-tools, site-renderer) | apache/maven-doxia-sitetools#701, closed | ported; usable only at Maven 4 runtime |
| maven-ear-plugin | 20 | partial: 49 unit tests, 103 EarMojoIT cases and 17 of 18 ITs pass; skinny-wars-timestamp fails (no timestamped snapshot version); includesDependencies ignored by the resolver |
|
| maven-ejb-plugin | 1 | ported, green locally (36 unit, 9 ITs); needs sisu.plexus at compile scope for the legacy BuildContext, as maven-resources-plugin does |
|
| maven-enforcer | enforcer-rules 38, enforcer-api 2, enforcer-extension 1 | partial: api and rules ported (347 tests, 0 failures); 3 rules removed for lack of API (requireUpperBoundDeps, banDynamicVersions, requireProfileIdsExist); plugin and extension excluded |
|
| maven-gpg-plugin | 9 | partial: green locally (13 ITs + 4 Bouncy Castle ITs; gpg signer ITs not runnable here); encrypted {...} passphrases have no API route and now fail explicitly |
|
| maven-help-plugin | 12 | ported, green locally (61 unit, 36 ITs); describe prefix lookup and evaluate rebuilt without a plugin manager or expression evaluator; effective-pom properties now sorted |
|
| maven-indexer | indexer-core 3 | partial: indexer-core ported (model only); indexer-cli and search-backend-indexer still wired through Sisu and fail at runtime | |
| maven-invoker-plugin | 18 | partial: 67 unit tests; 70 of 71 ITs run pass (22 not run); MINVOKER-377 fails because an alternate local repository cannot override the split layout; report goal blocked by the reporting chain |
|
| maven-jarsigner-plugin | 3 | ported, green locally (52 unit, 9 ITs); settings decryption rebuilt from plexus-sec-dispatcher internals | |
| maven-javadoc-plugin | 24 | partial: every goal runs directly (75 unit tests; ITs 79 β 75 passed, the 4 new failures are mvn site runs); as a site report blocked by the reporting chain |
|
| maven-jdeprscan-plugin | 5 | ported, green locally (6 unit, 6 ITs) | |
| maven-jdeps-plugin | 3 | ported, green locally (11 unit, 7 ITs); @Resolution fields stay null because plugin-tools writes no <resolutions> |
|
| maven-jlink-plugin | 5 | ported, green locally (17 unit, 28 ITs); module path now from DependencyResolver, LocationManager dropped |
|
| maven-jmod-plugin | 5 | ported, green locally (18 ITs); main-module-aware module path still from plexus-java LocationManager |
|
| maven-mapping | 1 | apache/maven-mapping#77, closed | ported; reflective file-name tokens lost |
| maven-plugin-tools | tools-api 13, annotations 4, generators 3 | partial: all but the descriptor model ported; maven-plugin-plugin and plugin-report excluded, do not compile | |
| maven-pmd-plugin | 26 | partial: check goals ported (20 unit, 5 new ITs); report goals blocked; check depended on the report only through @Execute, now removed |
|
| maven-project-info-reports-plugin | 26 | blocked: every goal is a report; ProjectBuilder cannot build a project from a repository artifact, and conflict data exists only as text |
|
| maven-rar-plugin | 4 | ported, green locally (4 ITs, one new covering dependencies); rar packaging still registered through Maven 3 components |
|
| maven-release | release-manager 59, release-api 7, oddeven-policy 1 | partial: libraries ported (791 tests, 0 failures); immutable model forced a DOM-editing redesign; maven-release-plugin excluded, does not compile | |
| maven-remote-resources-plugin | 8 | ported, green locally (11 unit, 9 + 7 ITs); supplemental-model merging reduced; a project resource can no longer exclude a bundle resource | |
| maven-reporting-exec | 21 | apache/maven-reporting-exec#167, closed | partial: public API ported, implementation stays on maven-core; ITs 5 of 5 β 0 of 5 |
| maven-reporting-impl | 8 | apache/maven-reporting-impl#254, closed | blocked: compiles but cannot render; ITs 6 of 6 β 1 of 6 |
| maven-resolver-ant-tasks | 10 | partial: model and settings ported; relies on internal ApiRunner for a Session outside Maven |
|
| maven-scm-publish-plugin | 2 | ported, green locally (5 ITs); ScmManager built from the Sisu index by hand, maven-scm has no non-Sisu factory |
|
| maven-scripting-plugin | 4 | ported, green locally (5 ITs); script binding project is now the v4 Project |
|
| maven-shade-plugin | 10 | partial: green locally (72 unit, 85 ITs), but the dependency-reduced POM can no longer become the published POM (the original is installed); transformer SPI unchanged, Shader SPI changes |
|
| maven-shared-jar | 4 | apache/maven-shared-jar#182, closed | ported |
| maven-site-plugin | 24 | partial: 10 goals run (deploy, stage, effective-site, attach-descriptor fully; site, jar, run without reports); 40 of 62 ITs, the other 22 lose report pages; reports need a plugin-manager API | |
| maven-surefire | maven-surefire-common 8; the forked-JVM modules use none | partial: maven-surefire-common ported; it holds the mojo base class, so surefire and failsafe plugins cannot move separately | |
| maven-toolchains-plugin | 9 | ported, green locally (8 ITs); an extension's toolchain factory is found only through the Sisu index |
Uses no Maven API
16 components
These use no import from Maven core, model, plugin or artifact packages and no org.apache.maven:* dependency (Doxia is not Maven API). They work on Maven 4 as they are; there is nothing to port.
| Component | Study PR | Result at rc-7 |
|---|---|---|
| maven-archetypes | green locally, 18 archetype builds; only archetype templates use the Maven API | |
| maven-doxia | apache/maven-doxia#1109 | CI-only PR closed unmerged |
| maven-doxia-converter | apache/maven-doxia-converter#165 | CI-only PR closed unmerged |
| maven-executor | green locally, 62 tests | |
| maven-file-management | apache/maven-file-management#119 | CI-only PR closed unmerged |
| maven-fluido-skin | apache/maven-fluido-skin#351 | CI-only PR closed unmerged |
| maven-invoker | apache/maven-invoker#189 | CI-only PR closed unmerged |
| maven-jarsigner | apache/maven-jarsigner#117 | CI-only PR closed unmerged |
| maven-jxr | only maven-jxr-plugin uses the Maven API (34 tests green on Maven 4) | |
| maven-reporting-api | apache/maven-reporting-api#88 | CI-only PR closed unmerged |
| maven-scm | green locally, 340 tests; only maven-scm-plugin uses the Maven API | |
| maven-script-interpreter | apache/maven-script-interpreter#223 | CI-only PR closed unmerged |
| maven-shared-resources | apache/maven-shared-resources#89 | CI-only PR closed unmerged |
| maven-shared-utils | apache/maven-shared-utils#442 | CI-only PR closed unmerged |
| maven-wagon | green locally, 1035 tests | |
| maven-wrapper | green locally, 34 tests; only maven-wrapper-plugin uses the Maven API |
Already on the Maven 4 API
12 components
- maven-archiver and maven-filtering
- maven-xinclude-extension
- maven-mvnd (
maven.versionis now 4.0.0-rc-7) - maven-clean-plugin, maven-compiler-plugin, maven-deploy-plugin, maven-install-plugin, maven-jar-plugin, maven-resources-plugin and maven-source-plugin on master, each with a
-3.xmaintenance branch - maven-war-plugin on its
4.0.xbranch (master is 3.x)
The 2022 mvn4 prototype branches, written against an earlier API, were deleted (61 branches).
Out of scope at the time: maven (core), maven-integration-testing and maven-resolver (core or below it); maven-verifier (superseded by maven-executor); maven-shared-incremental and maven-shared-io (retired); maven-doxia-linkcheck and maven-default-skin (archived); maven-plugin-testing (its master was empty); parent POMs, maven-apache-resources, maven-gh-actions-shared, maven-site, maven-sources and maven-dist-tool (no library code).
Activity
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
slachiewicz commentedon Sep 30, 2026
maven-shared-jar
PR: apache/maven-shared-jar#182. Status: ported, 4.0.0-SNAPSHOT, Java 17.
Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 91 tests before and after, 0 failures; spotless clean.Public API changes
RepositoryHashSearch.searchFileHash/searchBytecodeHash(andEmptyRepositoryHashSearch):List<org.apache.maven.artifact.Artifact>βList<org.apache.maven.api.Artifact>.EmbeddedMavenModelExposergains an injectedModelXmlFactoryand reads the POM into the immutable v4Model.@Named/@Singleton/@Injectmove fromjavax.injecttoorg.apache.maven.api.di, so Sisu no longer discovers these components; they cannot be injected under Maven 3.JarAnalyzer,JarData,JarClasses*,JarIdentification*unchanged.Gaps
maven-shared-componentsparent sets<proc>none</proc>, so themaven-api-diindex processor never runs;META-INF/maven/org.apache.maven.api.di.Injectis maintained by hand (as maven-filtering does). A new@Namedclass missing from it fails with "No binding".ModelXmlFactoryis implemented only inmaven-impl, so the model exposer needs a Maven 4 container; the v4MavenStaxReaderlives inmaven-support, which is not API.Consumers that break: maven-project-info-reports-plugin (
DependenciesReportinjectsJarClassesAnalysis;Dependencies,DependenciesRendereruse unchanged types). It compiles, but under Maven 3 the component is no longer found.Improvements: drops
javax.inject,sisu-maven-plugin,plexus-xml,maven-model,maven-artifact.Recommendation: port for Maven 4 plugins; keep a 3.x line while project-info-reports runs on Maven 3.
slachiewicz commentedon Sep 30, 2026
maven-mapping
PR: apache/maven-mapping#77. Status: ported, 4.0.0-SNAPSHOT, Java 17.
Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 8 tests before, 10 after (new: timestamped SNAPSHOTbaseVersion, non-jar extension), 0 failures; spotless clean.Public API change:
MappingUtils.evaluateFileNameMapping(String, org.apache.maven.artifact.Artifact)β(String, org.apache.maven.api.Artifact). Dependencies drop tomaven-api-coreonly.Gaps: tokens that no longer resolve
Artifacthas noArtifactHandler:@{packaging}@,@{language}@,@{directory}@,@{addedToClasspath}@,@{includesDependencies}@are gone.@{extension}@now comes fromArtifact.getExtension().@{type}@,@{scope}@,@{file}@. The path is available only viaArtifactManagerorDownloadedArtifact.Session.createArtifactneeds anInternalSession, so no public test fixture exists for a v4Artifact.Consumers that break (compile): maven-war-plugin
AbstractWarPackagingTask; maven-ear-pluginEarMojo,AbstractEarModule. Both must move to the v4Artifacttogether.Recommendation: port; small change and every commonly used token keeps a source. Keep 3.x for the Maven 3 lines of war and ear.
slachiewicz commentedon Sep 30, 2026
maven-reporting-exec
PR: apache/maven-reporting-exec#167. Status: partial, 3.0.0-SNAPSHOT, Java 17. Public API ported; implementation stays on maven-core.
Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 4 unit tests, 0 failures; ITs 0 of 5 pass (5 before). Every IT runs the released maven-site-plugin 3.22.0 against this snapshot and fails withNoSuchMethodError: MavenReportExecutorRequest.setMavenSession(MavenSession). Spotless clean.Public API changes
MavenReportExecutorRequest:get/setMavenSession(MavenSession)βget/setSession(org.apache.maven.api.Session);get/setProject(MavenProject)βorg.apache.maven.api.Project;setReportPlugins(org.apache.maven.model.ReportPlugin[])βorg.apache.maven.api.model.ReportPlugin[].MavenReportExecution:Pluginβorg.apache.maven.api.model.Plugin.MavenReportExecutor.buildMavenReportsthrows uncheckedMojoExceptioninstead of checkedMojoExecutionException.Gaps: the v4 API has no equivalent for what this component does
MavenPluginManager,PluginDescriptor,MojoDescriptor,MojoExecution,PluginVersionResolver, plugin realm setup, andLifecycleExecutor.calculateForkedExecutions/executeForkedExecutions.DefaultMavenReportExecutorandMavenPluginManagerHelpertherefore stay on maven-core.SessionβMavenSessionandProjectβMavenProjectonly via internal classes (InternalMavenSession.from(...),DefaultProject.getProject()).MavenProject.isExecutionRoot()has no equivalent;Project.isRootProject()means the.mvndirectory. This affectscanAggregate.@PlexusTest, since maven-testing targets v4-DI mojos. They needmaven-compatforToolchainManagerandplexus-xml4.2.0, because parent 50 manages 3.0.1, which fails withNoClassDefFoundError: Xpp3Dom$ChildrenTrackingon Maven 4.Consumers that break: maven-site-plugin only (
AbstractSiteRenderingMojo,AutoRefreshMojo,SiteMojo,SiteJarMojo,SiteRunMojo,ReportDocumentRenderer); shown at runtime by the ITs above.Recommendation: keep a 3.x line; this port is a facade only. A real Maven 4 version needs a report-execution or plugin-manager API in
org.apache.maven.api. If the Maven 4 site plugin gets one, retire this component in its favour.slachiewicz commentedon Sep 30, 2026
maven-common-artifact-filters
PR: apache/maven-common-artifact-filters#130. Status: ported, one feature removed, 4.0.0-SNAPSHOT, Java 17.
Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 231 tests before, 226 after, 0 failures. Six tests covered the removedactTransitively; one is new. Spotless clean.Public API changes
ArtifactFilterβPredicate<org.apache.maven.api.Dependency>inPattern{In,Ex}cludesArtifactFilter,Strict*,ScopeArtifactFilterandArtifactIncludeFilterTransformer.collection.*filters work onSet<Dependency>instead ofSet<Artifact>.Pattern{In,Ex}cludesArtifactFilter(Collection, boolean actTransitively)removed.ArtifactTransitivityFilter(Artifact, ProjectBuildingRequest, ProjectBuilder)β(Session, Artifact), collecting viaTEST_RUNTIME; this approximates the old project-build resolution.resolve.Node.getDependency()returns the immutableorg.apache.maven.api.model.Dependency.EclipseAether*transformers stay on the resolver API; nothing inorg.apache.maven.apimodels exclusions on aDependencyFilter.Gaps
Artifact,DependencyorNode, soactTransitivelyis removed. This is the largest loss; maven-assembly-pluginuseTransitiveFilteringdepends on it.VersionParseris only reachable through aSession, and filters are built without one; the port uses resolver-utilGenericVersionScheme.type,scopeandoptionallive only onDependency, so every filter moves fromArtifacttoDependency.Dependency,TypeorVersionwithout aSession; tests and consumers need stubs or Mockito.COMPILE_ONLY,TEST_ONLY,TEST_RUNTIME) have no defined behaviour inScopeArtifactFilter; they are included, like unknown scopes before.Consumers that break (compile): maven-dependency-plugin, maven-assembly-plugin, maven-javadoc-plugin (
ResourceResolver), maven-project-info-reports-plugin, maven-remote-resources-plugin, maven-surefire-common.Recommendation: port for 4.0.0 alongside a 3.x line, once a parent-aware replacement for
actTransitivelyis agreed.10 remaining items
[-]Port the shared components to the Maven 4 API[/-][+]Measure the impact of porting Maven components and plugins to the Maven 4 API[/+]slachiewicz commentedon Sep 30, 2026
Wave 3 findings
maven-build-cache-extension has its own comment above. Each port is a local branch
agent/mvn4-api; the PRs are not opened yet.Migration not needed
No Maven API in the library modules, so only CI changes (branch
agent/mvn4-api, one commit "Build with Maven 4 only"; PRs not opened yet). Verified locally withmvn verify, Maven 4.0.0-rc-7, JDK 21:Ported libraries
maven-surefire: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-SNAPSHOT, Java 17 (maven-surefire-common only).Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β before: 1487 tests in 12 modules, 0 failures (maven-surefire-common 867); after: maven-surefire-common 868 (865 withE2ETestexcluded, 0 failures), other library modules unchanged.E2ETest.endToEndTesttimes out under machine load on the unmodified tree too (36 s against 30 s). maven-surefire-plugin, maven-failsafe-plugin and surefire-its are out of the reactor, so their 35 unit tests and all ITs did not run after. Spotless and RAT clean.Only maven-surefire-common uses the Maven API. surefire-booter, -api, -extensions-api, -logger-api, -report-parser and the providers import none; they run in the forked test JVM, stay on
release 8, and need no port.Public API changes (maven-surefire-common)
AbstractSurefireMojoimplementsorg.apache.maven.api.plugin.Mojo;getSession(),getProject(),getToolchainManager()return v4 types;MojoFailureException/MojoExecutionExceptionboth become the uncheckedMojoException.getPluginDescriptor()removed;getPluginArtifactMap()/getProjectArtifactMap()return v4 artifacts, computed lazily.SurefireDependencyResolvertakes aSession;isWithinVersionSpecis no longer static.additionalClasspathDependenciesbecomesList<AdditionalClasspathDependency>, a new bean with the same XML, because the immutable v4 model cannot be populated from configuration.org.apache.maven.api.di; Sisu no longer discoversProviderDetectororSurefireDependencyResolver.Gaps
SurefireMojoandIntegrationTestMojocannot stay on Maven 3 while it moves: library and plugins must be ported together.MavenExecutionRequestin the API:-eand-ff/-fae/-fnno longer reach the forked JVM.${plugin.artifactMap},${project.artifactMap},${plugin},${basedir},${session.parallel}.Session.parseVersionRangeneeds a session.ArtifactHandler:isAddedToClasspath()becomes!Type.getPathTypes().isEmpty().ScopeArtifactFilterdiffers: withclasspathDependencyScopeExclude=providedorsystem, the v3 filter excludes nothing and the v4 one excludes that scope.LocationManager(plexus-java) is a Sisu component; created withnew.Consumers that break: maven-surefire-plugin, maven-failsafe-plugin, surefire-its in this repository. Outside it, only the maven-plugin-plugin
mplugin-305_*ITs extendAbstractSurefireMojo, and they pin 3.1.0.Improvements: maven-surefire-common drops maven-core, maven-plugin-api, maven-artifact, maven-model, maven-resolver-api/-util,
javax.inject,org.eclipse.sisu.plexus.Recommendation: port the library only together with maven-surefire-plugin and maven-failsafe-plugin, and keep a 3.x line. The API first needs the request flags on
Session, a session-free version parser, and test fixtures forDependencyandProject.maven-release: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-SNAPSHOT, Java 17. The library modules (maven-release-api,maven-release-manager, both policies) compile againstorg.apache.maven.apionly and pass; the plugin is a consumer and is excluded. The immutable model forced a redesign of the POM-rewriting layer, and plugin/extension/report artifact resolution is reduced.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β before 876 tests (api 0, manager 769, odd-even 11, semver 78, plugin 18), 0 failures, 18 skipped (manager); after 791 (api 0, manager 700, odd-even 12, semver 79), 0 failures, same 18 skipped. Spotless and checkstyle clean. The manager lost 88 tests and gained 19 (net -69). The 88 are the tests of the removed Maven 3 model subclasses, almost all assertingUnsupportedOperationExceptionfor methods that no longer exist:DomTripDependencyTest24,DomTripParentTest11,DomTripExtensionTest10,DomTripDependencyManagementTest6, and 37 of the 45 inDomTripBuildTest. The behaviour that was real (get/set version, group and artifact id, element name) is covered by the 10 tests ofDomTripMavenCoordinateTest; the parent test that added or removed a missing<version>element is not carried over. The other 9 new tests are 3 inDomTripBuildTest, 5 inDependencyInjectionTestand 1DiIndexTest(plus oneDiIndexTestin each policy module). The plugin's 18 unit tests and therun-itsprofile (it lives in the plugin module) were not run, before or after: the plugin does not compile against the ported libraries, so there is no "after".Public API changes
ReleasePhase.execute/simulate,ResourceGenerator.clean,Release*Request.get/setReactorProjects:List<MavenProject>βList<org.apache.maven.api.Project>.ReleaseEnvironment.getSettings()returnsorg.apache.maven.api.settings.Settings; newSession getSession()(phases need it forcollectDependenciesand the XML factories),DefaultReleaseEnvironment.setSession.ReleaseDescriptor.getOriginalScmInfo,ReleaseDescriptorBuilder.addOriginalScmInfoand the modello-generated descriptor:org.apache.maven.model.Scmβorg.apache.maven.api.model.Scm.IdentifiedScmis immutable:new IdentifiedScm(Scm, id), no setters (the v4Scmhas a protected builder constructor, so it can still be subclassed).VersionPolicyRequest.get/setMetaData:artifact.repository.metadata.Metadataβorg.apache.maven.api.metadata.Metadata.Version.compareTono longer throwsVersionComparisonConflictException(one ordering instead of two; the class stays, never thrown). Newversions.ArtifactKeys(versionlessKey,isSnapshot,SNAPSHOT_VERSION,VERSION_FILE_PATTERN) replacesArtifactUtils.DefaultReleaseManagerListener(Log)β(org.slf4j.Logger); the API has noLog.ModelETL.getModel()returns the newPomModel;ModelETLRequest.setProject(Project);AbstractRewritePomsPhase.transformScmtakes(Project, PomModel, Model originalModel, ...).DomTripDependency/Extension/Parent/DependencyManagement/PluginManagement/Reporting/ReportPluginare gone; the other DomTrip classes implement the newPomModel,PomBuild,PomPlugin,PomProfile,PomScmviews instead of subclassing Maven 3 model classes.ScmRepositoryConfigurator.getConfiguredRepository(..., Settings)takes the v4Settings.AbstractMavenExecutor,ForkedMavenExecutor,InvokerMavenExecutortake aSettingsXmlFactory;getSettingsWriter()βgetSettingsXmlFactory().PomFinder(Logger, ModelXmlFactory).GenerateReleasePomsPhasetakes aModelXmlFactoryinstead ofModelInterpolator.MavenCrypto(SecDispatcher)on plexus-sec-dispatcher 4.2.0.@Named/@Singleton/@Injectmove toorg.apache.maven.api.di,@Descriptionis dropped; Sisu no longer discovers any component.DefaultStrategy,DefaultVersionPolicy,DefaultNamingPolicybecome@Named("default")(see traps below).Design changes forced by the immutable model
DomTripModel extends Modelplus a dozen subclasses of Maven 3 model classes, overriding the setters they needed and throwingUnsupportedOperationExceptionfor the rest. The v4Modelcannot be edited in place, so the rewrite phases now edit the DOM through five smallPom*views (setVersion,setScm, coordinatesetVersion,Properties). This is a redesign, not a port: thetransformpackage goes from 2151 to 1598 lines, including the new interfaces.GenerateReleasePomsPhasebuilt the release POM by cloning theMavenProjectand calling setters; it now derives the release model withModel.newBuilder(effective, true).Gaps
MavenProject.getOriginalModel()(9 uses) has no equivalent. The original model is read again from the POM file withModelXmlFactory. Consequence:generate-release-pomsruns afterrewrite-poms-for-release, so it now reads plugin, extension and plugin-dependency declarations that are already rewritten; Maven 3 kept the load-time snapshot.RELEASE/LATESTresolution (MavenProject.getPluginArtifacts/getReportArtifacts/getExtensionArtifactsand their maps). Versions come from the effective model. A plugin, report plugin or extension without a version stays without one in the release POM (Maven 3 wrote the resolved version; one expected file had<version>RELEASE</version>and was changed), andCheckDependencySnapshotsPhasecannot see a snapshot behind it.Session.collectDependencies(project, TEST_COMPILE βͺ TEST_RUNTIME)replacesgetArtifacts/getDependencyArtifacts. It throws when any dependency POM cannot be read, where Maven 3 still listed the declared artifact; the code falls back to the declared coordinates and an empty transitive set.MavenProject.getParentArtifact(): onlyProject.getParent(), present when the parent project was built.ModelInterpolator. The super POM path unaligning inGenerateReleasePomsPhaseuses plexus-interpolation over the v4 model (kept as a dependency).api.Versionneeds aVersionParserservice, butVersionandDefaultVersionInfoare plain value classes. They use the resolver'sGenericVersionScheme(new direct dependencymaven-resolver-util); theComparableVersioncross-check is dropped.MavenCryptouses plexus-sec-dispatcher 4.2.0, whose legacy dispatcher can only decrypt.encryptSettingsneeds a v4masterdispatcher configuration; without one the passwords go unencrypted into the temporarysettings.xmlfor the forked build (the failure was already swallowed in Maven 3).maven-scm-manager-plexusgets its providers through Sisu map injection, which the v4 container does not do.ReleaseScmManagerreadsMETA-INF/sisu/javax.inject.Nameditself and instantiates the providers that have a public no-argument constructor.<proc>none</proc>, soMETA-INF/maven/org.apache.maven.api.di.Injectis maintained by hand in all three modules;DiIndexTestfails when a@Namedclass is missing (checked by removingDefaultStrategy).PrompterandSecDispatcherin a real Maven 4 plugin container.ApiRunner.createSessionbinds neither, so the tests bind them. No release was run end to end.@Namedis the empty key inMap<String, T>injection, notdefaultas in Sisu (Policy 'default' is unknown, available: []);model.with().parent(null).build()does not clear the parent (null is ignored on a builder fromwith(); usewithParent(null)orModel.newBuilder(model, true));DependencyResolver.collectneeds aProjectManagerservice that only maven-core provides.repositories/pluginRepositories(the central declarations are no longer in the model) and three extra properties (project.build.outputTimestamp,project.build.sourceEncoding,project.reporting.outputEncoding). 58 expected files undersrc/test/resources/projects/generate-release-pomswere adjusted for this.TestProjectfrom theModelBuilderof maven-impl and resolves against a local repository seeded fromsrc/test/remote-repository(marked>central=), with a stubProjectManager. It usesDefaultDependencyCoordinatesandInternalSessionfrom maven-impl, which are internal classes.Consumers that break: maven-release-plugin (same repository): 15 compile errors in 8 classes, measured by compiling its sources against the ported jars.
AbstractReleaseMojo:131(setSettingstakes the Maven 3Settings);CleanReleaseMojo,RollbackReleaseMojo,PrepareReleaseMojo,BranchReleaseMojo,PerformReleaseMojo,UpdateVersionsMojo(setReactorProjects(getReactorProjects())withList<MavenProject>, andnew DefaultReleaseManagerListener(getLog())withLog);AbstractScmReadReleaseMojo:145andUpdateVersionsMojo:124(addOriginalScmInfowith the Maven 3Scm). At runtime its@Inject ReleaseManagerandScmManagerwould also find no Sisu components. maven-scm-publish-plugin, by reading:AbstractScmPublishMojo:352passes a Maven 3SettingstogetConfiguredRepository, and it injectsScmRepositoryConfiguratorwithjavax.inject. No other repository under the Apache Maven plugin repositories importsorg.apache.maven.shared.release.Improvements: drops
maven-core,maven-model,maven-model-builder,maven-artifact,maven-settings,maven-plugin-api,maven-repository-metadata,plexus-interactivity-api,plexus-cipher,plexus-sec-dispatcher2.0 (it clashed by coordinates with the 4.2.0 that maven-impl brings),maven-scm-manager-plexus,javax.inject,org.eclipse.sisu.inject,sisu-maven-plugin, and the test-onlyplexus-testing,org.eclipse.sisu.plexusand four resolver modules.Recommendation: port the libraries for a Maven 4 release plugin, but only together with a Maven 4 port of the plugin. The API first needs a way to resolve plugin and extension versions and an original (file) model on
Project; without them the release POM and the snapshot check are weaker than on 3.x. Keep the 3.x line for Maven 3 builds.maven-enforcer: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-SNAPSHOT, Java 17.enforcer-apiandenforcer-rulesported; 3 of 38 rules removed for lack of API;maven-enforcer-pluginandmaven-enforcer-extensionexcluded from the reactor.Rebased 2026-10-06 onto master, carrying apache/maven-enforcer#1046, #1047 and #1051. The legacy rule API stays removed, as #1047 announces. Unit tests: 359 run, 0 failed (357 before the rebase, plus upstream's 2 new ones).
Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β before 300 tests (rules 276, plugin 24), 0 failures; after, library modules only: rules 347 (272 ported, 75 new), 0 failures. Spotless, checkstyle and RAT clean. ITs (154 invoker projects in the plugin module) cannot run after, because the plugin no longer builds. Removed tests: the 3 of the removed rules and 1 of a test-onlyPluginParameterExpressionEvaluatorsubclass.Public API changes
enforcer-api, the SPI third-party rules implement:AbstractEnforcerRuleConfigProvider.getRulesConfig()returnsorg.apache.maven.api.xml.XmlNodeinstead ofXpp3Dom. The deprecatedEnforcerRule,EnforcerRule2andEnforcerRuleHelperare removed; they exposePlexusContainerand the Maven 3Log.AbstractEnforcerRule,EnforcerRuleBase,EnforcerLogger,EnforcerLevel,EnforcerRuleException,EnforcerRuleErrorare unchanged.enforcer-rules: DI moves toorg.apache.maven.api.di, so Sisu finds no rule. Rules takeProject,Session,ProjectManager,VersionParserinstead ofMavenProject,MavenSession,RuntimeInformation,PluginManager,RepositorySystem.utils.ExpressionEvaluatorno longer extendsPluginParameterExpressionEvaluator;${mojo.*},${plugin.*},${localRepository}are not supported.requireUpperBoundDeps,banDynamicVersions,requireProfileIdsExist.Gaps
Nodehas no pre-managed version and no declared version constraint.requireUpperBoundDepscompares the pre-managed version andbanDynamicVersionschecks ranges andLATEST/RELEASEof transitive dependencies; a port would silently narrow both, so they are removed.Sessionhas no requested (-P) profile ids:requireProfileIdsExistis removed.Project: five rules re-parsepom.xmlthroughModelXmlFactory.requireSameVersions,bannedDependencies/requireReleaseDeps(searchTransitive=false) andenforceBytecodeVersionnow run a resolution request.ProfileActivationContextor no-opModelProblemCollector:requireOScarries hand-written implementations.requirePluginVersionsis tested against mocks only; its check for versions from the default lifecycle bindings is not verified on Maven 4.<rules>(PlexusComponentConfiguratorfromXpp3Dom) has no API equivalent; it belongs to the plugin port. Nothing ran end to end in a real Maven 4 build.Consumers that break
EnforceMojo,DisplayInfoMojo,DefaultEnforcementRuleHelper,EnforcerRuleCache) and maven-enforcer-extension (AbstractMavenLifecycleParticipant), both in this repository.MavenProject/MavenSessionthroughjavax.inject, so Maven 4 DI does not find them; it has to move with the plugin.EnforcerRule/EnforcerRule2or callingEnforcerRuleHelper.getComponent.Improvements:
enforcer-apidrops everything butmaven-api-xml;enforcer-rulesdrops maven-core, maven-artifact, maven-plugin-api, maven-model(-builder), maven-settings, maven-resolver-api/-util,javax.inject,org.eclipse.sisu.plexus, plexus-utils, plexus-xml.Recommendation: do not release. The rules are usable only once maven-enforcer-plugin can configure and look up v4 rules, which is the larger half. Ask apache/maven for a pre-managed version and declared constraint on
Nodeand requested profile ids onSessionbefore dropping the 3 rules for good. Keep a 3.x line for Maven 3 and for extra-enforcer-rules.maven-plugin-tools: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 5.0.0-SNAPSHOT, Java 17.Verified locally:
mvn verify -P run-itswith Maven 4.0.0-rc-7, JDK 21, library modules β api 61 unit + 15 IT before and after; generators 17 (1 skipped) before and after; annotations 37 before, 42 after (new: DI wiring, sources-jar resolution); 0 failures. Spotless clean. maven-plugin-plugin (12 unit, 32 ITs) and maven-plugin-report-plugin (3 unit, 12 ITs) were green before and are excluded from the reactor after.Everything except the descriptor model moves to the Maven 4 API.
PluginDescriptor,MojoDescriptorandParameterstay onorg.apache.maven.plugin.descriptorbecause the tools still write the Maven 3plugin.xml.Public API changes
PluginToolsRequest: constructor(Session, Project, PluginDescriptor);getProject()returnsProject;getDependencies()isSet<org.apache.maven.api.Artifact>;getSettings()is the v4Settings;getRepoSession()/setRepoSession()removed.PluginUtils.isMavenReport(String, Session, Project)replaces(String, MavenProject); deprecatedGeneratorUtils.isMavenReportremoved;toComponentDependenciestakes v4Dependency.PluginHelpGenerator:setMavenProject(Project);setVelocityComponentβsetVelocityEngine.MojoAnnotationsScannerRequesttakesSession,Projectand v4 artifacts;JavadocLinkGenerator/JavadocSitetake v4Settings.@Named/@Singleton/@Injectmove toorg.apache.maven.api.di: Sisu no longer finds the extractors, scanners or converters, so they cannot be injected under Maven 3.Gaps (rc-7)
org.apache.maven.api.plugin.descriptor,PluginXmlFactory), butMojoDescriptorhas nothreadSafe,instantiationStrategy,executionStrategyorrequiresReports,Parameterhas noimplementationorrequirement, andPluginDescriptorhas nodependencies. It cannot carry a Maven 3plugin.xml, so it cannot be the tools' internal model. There is also no plugin manager or descriptor lookup service.MavenProject#getArtifacts()has noProjectequivalent;Session#resolveDependencies(project, PathScope.MAIN_COMPILE)returns paths only and covers compile and provided scope, not runtime.MavenProject#getProjectReferences()has no equivalent; projects are matched fromSession#getProjects()by GAV.Dependencyfactory outside a resolved graph; noVersionfactory outside aSession;Settingshas nogetActiveProxy().ArchiverManager,VelocityComponent) cannot be injected throughapi.di; sources jars are unpacked withjava.util.zip(with a zip-slip check), so only*-sources.jaris supported.<proc>none</proc>in the parent: the DI index files are maintained by hand; a new test fails when an entry is missing.ProjectManager#getEnabledSourceRootsis stubbed in tests; nothing ran the extractors end to end on a real Maven 4 project.Consumers that break
DescriptorGeneratorMojo,HelpGeneratorMojo; maven-plugin-report-pluginPluginOverviewRenderer,GoalRenderer. Both are excluded from the reactor.Session/ProjectAPI.Improvements: drops maven-core, maven-settings, maven-resolver-api,
javax.inject,plexus-archiver,plexus-velocity,sisu-maven-plugin. Still needs maven-plugin-api, maven-model, maven-artifact for the descriptor model.Recommendation: do not release a "Maven 4 API" 5.0.0 while the public descriptor types are Maven 3. Decide first between a tools-owned descriptor model and dropping Maven 3
plugin.xmloutput; keepmaven-plugin-tools-3.xas the line maven-plugin-plugin builds on.maven-archetype: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 57 tests before (archetype-common 29, maven-archetype-plugin 28), 0 failures; after 30 in archetype-common (29 ported, 1 new), 0 failures, spotless clean. The plugin (28 tests, 33 integration test projects) is a consumer that does not compile against the ported library, so it is excluded from the reactor and its tests and ITs were not run after.-Prun-itsbefore: 20 of 33 IT projects finished (all passed) when the 30-minute time box ended. For the code with no unit test (FilesetArchetypeCreator, POM rewriting) I generated an archetype from a 3-module fixture with both builds and diffed the output trees: identical apart from the version string and a timestamp, withkeepParenttrue and false.Public API changes (archetype-common)
ArchetypeGenerationRequest:MavenSession,RepositorySystemSession,RepositorySystem,ProjectBuildingRequest,ArtifactRepository(local and remote) getters and setters are replaced by onegetSession()/setSession(org.apache.maven.api.Session);getRemoteRepositories()is nowList<org.apache.maven.api.RemoteRepository>.ArchetypeCreationRequest.project:MavenProjectβorg.apache.maven.api.Project.ArchetypeManager,ArchetypeDataSource,Downloader,ArchetypeArtifactManager:RepositorySystemSessionβSession, aetherRemoteRepositoryβ APIRemoteRepository.ArchetypeManager.archiveArchetypeno longer declaresDependencyResolutionRequiredException.PomManagerreads and writes the immutableorg.apache.maven.api.model.Model. Constructors change:DefaultPomManager(ModelXmlFactory),DefaultOldArchetype(ArchetypeVelocity, ArchetypeArtifactManager, ModelXmlFactory),DefaultFilesetArchetypeGeneratortakesArchetypeVelocityinstead ofVelocityComponent,DefaultArchetypeGeneratordropsRepositorySystem.plexus-velocityis gone; the newArchetypeVelocitybuilds the engine with the settingsDefaultVelocityComponent2.4.0 applies (read from its bytecode) plus the formerVelocityConfiguratorsettings. TheVelocityComponentConfiguratorextension point is lost.@Named/@Singleton/@Injectmove toorg.apache.maven.api.di; Sisu no longer discovers these components, so they cannot be injected under Maven 3.Gaps
RemoteCatalogArchetypeDataSourcenow fetchesarchetype-catalog.xmlthroughTransportProvider: no local repository cache, update policy or checksum check. The old lookup also matched a repository by the id of a repository it mirrors (getMirroredRepositories()); the APIRemoteRepositoryhas none, so only idsarchetypeandcentralmatch. Not exercised by a test (none existed).RepositoryPolicycannot be set on a repository created withSession.createRemoteRepository(id, url); thearchetypeRepositoryURL used to get always-update and warn-on-checksum, it now gets the defaults. Mirror, proxy and authentication handling for it relies on the API resolving throughtoResolvingRepositories; not exercised.<reports>(project and profile) and plugin<goals>in strict mode; the Maven 3 reader accepted them.DefaultPomManagerandDefaultOldArchetyperead non-strict, so any unknown element is now accepted too.MavenJDOMWritercannot read those elements from the v4 model and leaves them untouched in the file (new testtestAddParentKeepsLegacyElements).Model.Builder.parent(null)/modules(null)on a builder made withModel.newBuilder(model)does not clear the value (null means inherit from base);newBuilder(model, true)is required. The first version of the port kept<modules>in the root archetype POM for this reason; the tests did not catch it, the fixture diff did.maven-parentsets<proc>none</proc>, soMETA-INF/maven/org.apache.maven.api.di.Injectis maintained by hand (14 classes).ApiRunner.createSessionhas no transporter. The tests registerfileand Apache HTTP factories with@Provides @Namedon a class passed toinjector.bindImplicit; that pullsmaven-resolver-transport-fileand-apache2.0.23 into test scope.Consumers that break: maven-archetype-plugin, in this repo (excluded from the reactor, not ported):
CreateProjectFromArchetypeMojo(setMavenSession,setRepositorySession,setRepositorySystem,setProjectBuildingRequest,setLocalRepository,setRemoteArtifactRepositories),IntegrationTestMojo(setMavenSession,Downloader.download),CreateArchetypeFromProjectMojo(setProject(MavenProject)),UpdateLocalCatalogMojoandDefaultArchetypeSelector(RepositorySystemSession),DefaultArchetypeGenerationConfigurator(VelocityComponent,RepositorySystemSession). The plugin is a Maven 3 mojo and also relies on Sisu discovery. No other repository under the Apache Maven plugin repositories, shared, shared-4 or skins imports archetype-common.Improvements: drops
maven-core,maven-model,maven-artifact,maven-resolver-api,javax.inject,plexus-velocity, and test-sideplexus-testing,maven-resolver-connector-basic,maven-resolver-transport-http.plexus-utilsandplexus-xmlstay (generated archetype descriptor and catalog readers).Recommendation: the library ports without dropping behaviour except the remote-catalog and repository-policy gaps above. Do not release it before the plugin is ported to the Maven 4 mojo API and its 33 ITs run against it; keep the 3.x line for Maven 3 users.
maven-resolver-ant-tasks: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 3.0.0-SNAPSHOT, Java 17.Verified locally:
mvn verify -P run-itswith Maven 4.0.0-rc-7, JDK 21 β 59 tests before, 60 after (newAntModelResolverTest), 0 failures; the POM-reading parity golden file and all 11ResolveTestcases pass unchanged; spotless clean. Cost:run-itsbuild 2:46 β 9:17, not profiled.Only the model and settings layer moves to the v4 API. Collection, resolution, install and deploy stay on the resolver's
RepositorySystem.Central finding: no public
Sessionoutside Maven. Ant has no Maven runtime. The only route isorg.apache.maven.impl.standalone.ApiRunnerinmaven-impl, which is internal. Its session has no transporter, cannot take the Ant project'sRepositorySystem(local repository, mirrors, proxies, credentials), and a customModelResolverreplaces the default only as a@Named @Priorityclass, not throughbindInstance.Public API changes (internal packages, but the uber jar is what Ant users load)
AntRepoSys.loadModelandPom.getModelreturn the immutableorg.apache.maven.api.model.Model;CreatePombuilds through newaddRepository,addDeveloper,setScm.AntSecDispatcher,AntSettingsDecryptorFactory,SettingsUtilsremoved: the v4SettingsBuilderdecrypts and converts profiles. A Maven 3settings-security.xmlmaster password still decrypts.Gaps
maven-resolver-supplier-mvn4; only the root POM uses the v4ModelBuilder, so both builders are on the classpath.RemoteRepositoryhas only id, URL and protocol. Read from the API; no test covers it.BUILD_PROJECTneeds.mvnorroot="true", so the root POM is built withBUILD_EFFECTIVE/CONSUMER_DEPENDENCY;setProcessPlugins(false)has no equivalent.META-INF/maven/org.apache.maven.api.di.Injectand leaveorg.apache.maven.implandapi.spiunrelocated; the uber jar grows 4.95 MB β 8.22 MB.Consumers that break: none in the estate; user Ant builds need Java 17 and see the v4 model from
Pom.getModel.Improvements: drops
maven-settings-builder,plexus-cipher,plexus-sec-dispatcher,maven-resolver-supplier-mvn3; fixes an NPE on an unreadablesettings.xml.Recommendation: do not merge. The port rests on internal
ApiRunner; ask apache/maven for a supported standaloneSessionfactory that accepts aRepositorySystemand aModelResolver. Keep 2.x on Maven 3 for Java 8 Ant users.maven-indexer: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 8.0.0-SNAPSHOT, Java 17.indexer-coreported;indexer-cliandsearch-backend-indexercompile but fail at runtime (Sisu wiring), left unported.Verified locally:
mvn -B verifywith Maven 4.0.0-rc-7, JDK 21.indexer-core: 245 tests, 0 failures, 1 skipped, plus 5 ITs, before and after.indexer-reader23 (1 skipped),search-api4,search-backend-smo15 (14 skipped),search-backend-remoterepository39: unchanged.indexer-cli: 7 tests, 0 errors before, 5 errors after (its 6 ITs no longer reached).search-backend-indexer: 9 tests (7 skipped), 0 errors before, 2 errors after. Theexamplesprofile (indexer-examples-*tests, off by default) was not run. Spotless clean.Public API changes
ArtifactContext.getPomModel():org.apache.maven.model.Model(maven-model) βorg.apache.maven.api.model.Model. This is the only Maven type in the public API;MinimalArtifactInfoIndexCreatorreads name, description and packaging from it.org.apache.maven.model.v4.MavenStaxReader(maven-support), andArtifactLocatorno longer handlesXmlPullParserException.@Named/@Singleton/@Injecton all 19 components move fromjavax.injecttoorg.apache.maven.api.di. Sisu and Guice no longer discover them, soWireModule/SpaceModule,InjectedTestand Plexus lookups return nothing. Bare@Namedis dropped because the v4 annotation requires a value.min,jarContent,maven-plugin, ...) andList<IndexCreator>/Map<String, IndexCreator>injection work in maven-di as-is.Gaps
maven-compiler-pluginhas<proc>none</proc>, soMETA-INF/maven/org.apache.maven.api.di.Injectis maintained by hand (19 classes); a new component missing from it fails with "No binding".DefaultIndexUpdater(β¦, List<IndexUpdateSideEffect>)failed with a DI error because no side effect is bound. Fixed with@Nullableon the parameter (maven-api-annotations); the existing null check covers it. Behavioural difference: the list isnull, not empty, when nothing is bound.ModelXmlFactoryneeds a Maven 4 injector, andMavenStaxReadersits inmaven-support, which is notmaven-api-*.InjectedTestreplaced by a localAbstractTestSupportthat buildsInjector.create().discover(...); no test removed.archetype-catalog(ArchetypeDataSource, optional, Maven 3 artifact) and plexus-utilsStringUtils/FileUtils/Xpp3Dom/DAG, which are not Maven APIs;plexus-utilsis now declared explicitly because it used to arrive throughmaven-model.javaVersion11 β 17 makes modernizer flag sixString.formatsites; modernizer pinned at 11 to keep them out of this change.indexer-examples-springtest-onlymaven-model-builderpinned to a newmaven3.version(3.9.16) because it uses the v3ModelWriter.maven-api-core: not appropriate here. Nothing in
indexer-coreusesSession,Artifact,Projector any service; the three files with Maven 3 API use only the model. The port depends onmaven-api-model,maven-api-di,maven-api-annotationsandmaven-support(which pullsmaven-xml,maven-api-settings/-toolchain/-metadata/-plugin, all Java 17). For an artifact consumed by IDEs, repository managers and search tooling outside Maven, dropping the Maven dependency is the better port: only name, description and packaging are read, which a JDK StAX parse covers, and DI could be JSR 330 only (javax.inject/jakarta.inject), which Sisu, Guice and Spring all honour. Forcingorg.apache.maven.api.dion those consumers replaces a de-facto standard with a Maven-internal one. Not implemented; measured only the api.di port.Consumers that break
NullInjectedIntoNonNullablebecause Sisu finds no components):indexer-cli(Components,NexusIndexerCli,NexusIndexerCliTest),search-backend-indexer(IndexerCoreSearchBackendPagingTest,IndexerCoreSearchBackendImplTest);indexer-examples-basic(BasicUsageExample) andindexer-examples-springuse the same Guice/Sisu wiring, tests not run.org.apache.maven.indexand noorg.apache.maven.indexerdependency outside the repo itself. External consumers (IDE, repository manager, search tooling) cannot be checked from here; anyone callingArtifactContext.getPomModel()or wiring through Sisu breaks.Improvements: drops
javax.inject,org.eclipse.sisu.injectandguice(provided) fromindexer-core, andmaven-model.Recommendation: do not merge as is. Keep
indexer-core7.x on JSR 330 for the non-Maven consumers; if a Maven 4 line is wanted, prefer replacingMavenXpp3Readerwith a small StAX read and keepingjavax.inject, rather thanorg.apache.maven.api.di.slachiewicz commentedon Sep 30, 2026
Wave 4 findings, part 1 of 4: maven-acr-plugin to maven-dependency-plugin
Each plugin is a local branch
agent/mvn4-apiwith a "Build with Maven 4 only" commit and a "Port to the Maven 4 API" commit; the PRs are not opened yet.maven-acr-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT (was 3.2.1-SNAPSHOT), Java 17.Rebased 2026-10-06 onto master, which carries apache/maven-acr-plugin#155 and #157. The port keeps the Sisu-indexed
AppClientArtifactHandlerandAppClientLifecycleMappingProviderthat #157 adds; whether rc-7 discovers them is not yet verified. 2 unit tests pass; ITs not rerun.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifyβ BUILD SUCCESS before and after; the plugin has no unit tests (0 before, 0 after).mvn verify -Prun-itsβ 4/4 invoker ITs pass before (3m20s) and after;spotless:checkclean. Consumed released artifacts only, no local snapshots: maven-archiver 4.0.0-beta-5, maven-filtering 4.0.0-beta-1, maven-plugin-plugin 4.0.0-beta-1.User-visible changes
AcrMojoimplementsorg.apache.maven.api.plugin.Mojo, annotated withorg.apache.maven.api.plugin.annotations; project, session,Log,ProjectManagerandMavenFileFilterare@Injected. Goalacr, phasepackageand every parameter name/property (maven.acr.*,jarName,excludes,archive,filters,outputTimestamp) are unchanged;basedirandoutputDirectoryare nowPath(same XML syntax).javax.inject,maven-plugin-api,maven-core,maven-artifactdropped). A 3.x line has to stay for Maven 3 users.ProjectManager.attachArtifact(project, project.getMainArtifact(), jar)instead ofproject.getArtifact().setFile.META-INF/application-client.xmlto the user'sexcludeslist in place; it now copies the list.Providersclass (@Provides) suppliesProjectManagerandBuildContext; the second is needed becauseDefaultMavenFileFilter4.0.0-beta-1 requires aBuildContextbinding (the same workaround maven-resources-plugin carries). Without both, every IT failed with "No binding to construct an instance for key ...".Gaps
org.eclipse.sisu:org.eclipse.sisu.plexusmust be a compile dependency:ThreadBuildContext(plexus-build-api 0.0.7) needsorg.codehaus.plexus.logging.AbstractLogEnabled, which the v4 plugin realm does not provide. The four ITs pass without it (the<extensions>true</extensions>realm supplies the class), but invoking the goal directly on a jar-packaged project (mvn ...:maven-acr-plugin:4.0.0-beta-1-SNAPSHOT:acr) failed with "Unable to lookup Mojo" until the dependency was added; afterwards it built the jar. maven-resources-plugin master carries the same dependency.@Mojo(dependencyResolutionPathScopes = "runtime")(the v4 replacement forrequiresDependencyResolution = RUNTIME) cannot be used: maven-plugin-plugin 4.0.0-beta-1 fails with "Method: 'dependencyResolutionPathScopes' not found in class MojoAnnotationContent". The attribute is omitted; this is safe here becauseMavenArchiver.getManifestresolvesMAIN_RUNTIMEon demand throughDependencyResolver, which is what all four ITs exercise (manifest classpath included).app-clientpackaging still needsMETA-INF/plexus/components.xml(LifecycleMapping+ArtifactHandler). A pure v4 registration viaPackagingProvider+TypeProvidercompiled and its beans were indexed, but with the components.xml removed and a clean build, it-01 failed withUnknown packaging: app-client.DefaultPackagingRegistry.lookupin maven-4.0.x resolves only through the SisuLifecycleMappingcomponent and never consultsPackagingProvider, so the SPI is inert. The experiment was reverted; the file is unchanged and works under rc-7.maven-plugin-testingv4 harness was not added: no unit test existed to port.Improvements: drops
javax.inject,maven-plugin-api,maven-core,maven-artifact,maven-plugin-annotations,plexus-utils(FileUtilsreplaced byjava.nio.file.Files). Addsmaven-api-core/di/annotations(provided),plexus-build-apiandorg.eclipse.sisu.plexus.Recommendation: port for Maven 4; keep a 3.x line for Maven 3 builds. Follow up upstream on two items:
PackagingProvidernot honoured byDefaultPackagingRegistry(blocks removing components.xml from packaging plugins), and maven-plugin-tools not extractingdependencyResolutionPathScopes.maven-antrun-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported (two workarounds for Maven 4.0.0-rc-7 defects), 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verify -Prun-itswith Maven 4.0.0-rc-7, JDK 21 β 4 unit tests and 29 invoker ITs before, 4 and 29 after, 0 failures (before 9:52 min, after 10:08 min); spotless clean. The "before" numbers are the 3.2.1 code built and run by Maven 4.Ant-visible references (all registered on the Ant project by
AntRunMojo)maven.compile.classpath,maven.dependency.classpath,maven.runtime.classpath,maven.test.classpathPathfromMavenProject.get*ClasspathElements()Session.resolveDependencies(project, MAIN_COMPILE / MAIN_RUNTIME / TEST_RUNTIME)maven.plugin.classpathPathfrom${plugin.artifacts}URLClassLoaderURLs ofMojoExecution.getPlugin().getClassLoader()(see Gaps)maven.projectorg.apache.maven.project.MavenProjectorg.apache.maven.api.Projectmaven.project.refMavenAntRunProjectholding aMavenProjectgetMavenProject()now returnsorg.apache.maven.api.Projectmaven.project.helperMavenProjectHelpermaven.sessionreplaces it (attach goes throughProjectManager.attachArtifact)maven.local.repositoryLocalRepository(getBasedir())org.apache.maven.api.LocalRepository(getPath())maven.local.repository.managerLocalRepositoryManagerSession.getPathForLocalArtifactviamaven.sessionmaven.sessionorg.apache.maven.api.Sessionmaven.dependency.artifactsList<MavenAntRunDependency>(dependency + path); replacesMavenProject.getArtifacts()for the tasksUnchanged: the Ant properties (
project.*,localRepository,settings.localRepository, one property per dependency conflict id,maven.project.dependencies.versions), themaven.project.dependenciesfileset and the per-artifact filesets, and themvn:attachartifact/mvn:dependencyfilesetstask names and attributes.Public API changes
AntRunMojoimplementsorg.apache.maven.api.plugin.Mojo(wasAbstractMojo);execute()throwsMojoException;DEFAULT_MAVEN_PROJECT_HELPER_REFIDremoved,DEFAULT_MAVEN_SESSION_REFIDandDEFAULT_MAVEN_DEPENDENCIES_REFIDadded;copyPropertiestakesorg.apache.maven.api.Projectplus the resolved dependencies;getLocalRepository()returnsorg.apache.maven.api.LocalRepository.MavenAntRunProject,MavenLogger(now takesapi.plugin.Log),DependencyFilesetsTask.filterArtifacts(List<MavenAntRunDependency>),SpecificScopesArtifactFilterandTypesArtifactFilter(nowPredicate<org.apache.maven.api.Dependency>) change signature. NewMavenAntRunDependencyrecord.${plugin.artifacts}and${repositorySystemSession}are no longer injected;sourceRoot/testSourceRoot(removed, fail-fast) areStringinstead ofFile;@Mojo(threadSafe, requiresDependencyResolution)has no v4 attribute in use, dependencies are resolved on demand inexecute().AntrunXmlPlexusConfigurationWriter(package-private) is replaced byAntrunXmlConfigurationWriteroverXmlNode; output is identical for the 4 existing writer tests.Gaps
XmlNode-typed@Parameterdrops every XML attribute and namespace:DefaultBeanConfigurator.XmlConverter.toXmlcallsXmlNode.newInstance(name, value, null, children, null). Ant tasks are attribute-based, so the plugin reads<target>fromMojoExecution.getConfiguration()instead; the injectedtargetfield stays only as the declared parameter. Consequence: runtime Maven expressions inside<target>that are not resolved at model time (for example${session...}) are no longer evaluated by Maven; no IT covers them.MojoExecution.getPlugin().getDependencies()throws an NPE from the second plugin execution in a build (DefaultMojoExecution.getDependenciesMapuses a nullPluginDescriptor.getDependencyNode()); reproduced by themultiple-phase-testIT.maven.plugin.classpathis taken from the plugin realm URLs instead, which includes dependencies added in the project's<plugin><dependencies>.PathScopecontains thesystemdependency scope (test-runtime= compile, provided, test, runtime, test-runtime), so system-scoped dependencies are absent from the classpaths, properties and filesets. No IT covers it.MojoFailureException: every Ant failure is aMojoException(build failure vs. error is lost).Build.getSourceDirectory()andgetTestSourceDirectory()are deprecated in the v4 model and still feedproject.build.sourceDirectory; projects that only declare<sources>are not covered.MavenProjectthroughmaven.project(getArtifacts(),addCompileSourceRoot,getProperties()β¦) has no direct v4 equivalent onapi.Project.usage,tasks/*) still describe the old references; not updated.User-visible changes: requires Maven 4; the reference and parameter changes above; Ant scripts or custom tasks that cast
maven.projecttoMavenProject, readmaven.project.helperormaven.local.repository.managerbreak. No Java code under the Apache Maven repositories imports the changed types (grep overorg.apache.maven.plugins.antrun/org.apache.maven.ant.tasks); POM users of the plugin were not inspected.Improvements: drops
maven-plugin-api,maven-core,maven-artifact,maven-model,maven-plugin-annotations,javax.inject,org.eclipse.sisu.plexus,plexus-utils,plexus-xml; addsmaven-api-core/annotations/model/xml/di(provided). No MXSerializer.Recommendation: port for Maven 4 plugins and keep a 3.x line for Maven 3 users. Before merging, ask Maven core for attribute-preserving
XmlNodeparameters (or documentMojoExecution.getConfiguration()) and fix the null dependency node inDefaultMojoExecution.maven-artifact-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT (was 3.7.1-SNAPSHOT), Java 17.buildinfo,compare,describe-build-outputandcheck-buildplanare ported;reproducible-centralcompiles but cannot run, and one IT cannot pass.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifybefore β 2 tests, 0 failed, 0 skipped; after β 25 tests, 0 failed, 0 skipped, but only with-Dpgpverify.skip=true(see Gaps).mvn verify -Prun-itsbefore β 13 passed, 3 failed (git-mono,git-multi,describe-multi), 0 skipped (12m10s); after β 12 passed, 4 failed (the same three, plusbuildinfo-dir), 0 skipped (17m18s), both run on a copy of the tree. The three common failures are not caused by the plugin:git-*stop in git-commit-id-plugin with "Could not get HEAD Ref" (the copied tree has no commits),describe-multistops in apache-rat onbuild.log.1and the Maven 4 consumer POM.spotless:checkclean. Consumed: releasedorg.apache.maven.shared:maven-archiver:4.0.0-beta-5, and the local snapshotsmaven-reporting-implandmaven-reporting-api5.0.0-SNAPSHOT (branchagent/mvn4-apiof maven-reporting-impl, commit 21c3da4, already in the local repository, not rebuilt).User-visible changes
buildinfo,compare,describe-build-output,check-buildplan,reproducible-centralkeep their names, phases and parameters (buildinfo.*,reference.repo,compare.*,check.*,diagnose,outputTimestamp);buildinfoFileandcheck.plugin-issuesare nowPath.threadSafeis gone from@Mojo(the API annotation has none). Runs only on Maven 4: a 3.x line has to stay.RangesUtilis no longer a Sisu component: it is a static utility returningRangeDependencyrecords (groupId,artifactId,version,message).compare: the reference is the file of the local repository when there is one (installed, or cached from the reference repository), else it is downloaded from the reference repository with theTransportservice, without looking at the reactor. The log line "Comparing against N reference files from ..." now showsid (url).check-buildplan: the plan is computed from the effective POM (see Gaps).Dependency g:a:jar:v (scope) via ... has been resolved from a version range [a,b)).Gaps
check-buildplanhas no v4 route toLifecycleExecutor.calculateExecutionPlan/MavenExecutionPlan. The plugins of the plan are the plugins of the effective POM'sbuild/plugins(Maven 4 injects the packaging bindings there) that have an execution with goals in a phase up to the phase of a task (Maven 3 phase names matched throughLifecycle.aliases()) or in no phase. Not covered: tasks that are goals (-Dcheck.buildplan.tasks=foo:bar), plugins forked by@Execute, and executions whose phase only comes from the goal's default phase in a plugin descriptor when the POM gives none (those are counted as in the plan, which can over-report). The fivecheck-buildplan-*ITs pass.Nodecarries noVersionConstraint, so direct ranges come fromProject.getDependencies()(overlaid withgetManagedDependencies()), and transitive ones from building the POM of every node of the graph withProjectBuilder. A dependency whose POM cannot be resolved or built hides the ranges of its own dependencies; relocated dependencies are not followed.check-buildplan-version-range-*andcompare-mono(buildinfomvn.rebuild-args) pass.comparehas no resolver provenance:DownloadedArtifactgives a path, not the repository. "Installed locally" is read from_remote.repositories(file>=), which resolver documents as internal. Workspace-free download usesTransportProvider;Session.createRemoteRepositorydoes not apply mirrors to anid::urlorurlreference repository (not measured).reproducible-centralcompiles againstmaven-reporting-impl5.0.0-SNAPSHOT, butmvn org.apache.maven.plugins:maven-artifact-plugin:4.0.0-beta-1-SNAPSHOT:reproducible-centralfails withNoClassDefFoundError: org/apache/maven/execution/MavenSession: the Doxia site tool behindAbstractMavenReportneeds Maven 3 types that the plugin realm of a Maven 4 plugin does not see (the same blocker as the reporting-impl port). No IT covers this goal.@Mojo(requiresDependencyResolution = RUNTIME)cannot be written either (dependencyResolutionPathScopesis not extracted by maven-plugin-plugin 4.0.0-beta-1); the report collects the runtime graph itself.buildinfo-dir(MARTIFACT-26) fails: it expects the warning "Ignoring artifact ...:pom:4.3.10 because it points to inexistent ..." for the main artifact of apom-packaged module. In the v4 API apomproject has no main artifact (Project.getMainArtifact()is empty unless there are two artifacts), so there is nothing to warn about. The buildinfo itself is written correctly. The IT is unchanged.mvn verifyruns pgpverify: its keys map has no entries for the new artifacts, and the locally built rc-7 artifacts are unsigned, so the goal fails;pgp-keys-map.listis not updated.Sessionhas no top-level project:Project.isTopProject()is used;MavenProject.getOriginalModel()is read back from the POM file withModelXmlFactory.Tests: the two existing tests are unchanged. New:
RangesUtilTest,CheckBuildPlanMojoTest,PluginUtilTest,LocalRepositoryOriginTest,OutputArtifactTest(23 tests).Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-artifact,maven-resolver-api,maven-resolver-util,plexus-utils,plexus-xml,commons-io,javax.injectandmaven-plugin-annotations(the Maven 3maven-archiver3.6.6 is replaced by 4.0.0-beta-5, used only forparseBuildOutputTimestamp). Addsmaven-api-core/di/annotationsandmaven-xml(provided) and the two reporting snapshots.Recommendation: port for Maven 4 and keep a 3.x line for Maven 3. Do not release before the reporting chain is ported: the report goal cannot run. Upstream follow-ups worth filing: expose the repository of a resolved artifact and a way to resolve without the workspace; put
VersionConstraint(and the pre-managed version) onNode; give the API an execution-plan service for tasks.maven-assembly-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17. Needs an unreleased plexus-archiver (see Gaps, first item).Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 273 unit tests before, 271 after, 0 failures/errors/skipped both (3 tests removed, 1 added, listed below); checkstyle, RAT, dependency:analyze andspotless:checkpass.mvn verify -Prun-its(155 project ITs): the before run hit the 30 min time-box after 65 ITs (65 passed, 0 failed;exit=143). After: the same 65 β 65 passed in 7 min, and the other 90 β 89 passed, 1 failed (depSet-transFromProfile, which the POM's ownpomExcludesexcludes fromrun-its; I listed it by hand, so it is not a regression). The ITs ran as two-Dinvoker.test=batches (the 65 that finished before, then the remaining 90) because the full profile exceeds the time-box on this machine. Shared snapshots consumed: maven-archiver 4.0.0-beta-6-SNAPSHOT, maven-filtering 4.0.0-beta-2-SNAPSHOT, maven-common-artifact-filters 4.0.0-SNAPSHOT (all from their localagent/mvn4-api/master worktrees), plexus-archiver 5.0.0-SNAPSHOT (master plus a 4-line local patch,asm-plexus-archiver-prototype.diff). maven-mapping is not a dependency of the plugin (no import, not in the tree), so nothing is lost there.Public API changes (for people who call or extend the plugin classes; the descriptor model
Assembly,ModuleSet, ... is unchanged)AbstractAssemblyMojoimplementsorg.apache.maven.api.plugin.Mojo; services are@Injectfields (Session,Project,Log,MojoExecution,AssemblyArchiver,AssemblyReader,MavenReaderFilter). The four-argument constructor is gone.AssemblerConfigurationSource:MavenProjectβorg.apache.maven.api.Project,MavenSession getMavenSession()βSession getSession(),MavenArchiveConfigurationis noworg.apache.maven.shared.archiver(itsgetManifestFile()is aPath).artifact.AssemblyArtifactreplacesorg.apache.maven.artifact.Artifactthroughout (resolver, tasks, filters). The v4 API splits coordinates (Dependency), file and dependency trail;AssemblyArtifactholds all three and keeps the v3 getter names that${artifact.*}/${module.*}expressions use.ProjectBuilder,ArtifactHandlerManager,RepositorySystem,PlexusContainer,BasicComponentConfiguratorare no longer constructor arguments of the phases, the resolver andDefaultAssemblyArchiver.AddDependencySetsTaskandModuleSetAssemblyPhaselose theirProjectBuilderparameter;FilterUtils.filterProjectsgains aSession.AssemblyProxyArchiverno longer implements the deprecatedArchivermethods (addDirectory(...),addArchivedFileSet(File, ...),getFiles,setUseJvmChmod,setLastModifiedDate, ...): plexus-archiver 5.0 removed them.ContainerDescriptorHandlerSPI is unchanged (ArchiveFinalizer+FileSelector); how handlers are found changed, see Gaps.Gaps (what has no v4 equivalent or had to be worked around; each verified by a concrete failure)
ArchiverManagercannot be obtained without Sisu in a v4 mojo, and plexus-archiver's "no DI" mode is incomplete. Probe plugin on rc-7:Lookup.lookup(ArchiverManager.class)βNoSuchElementException;lookupMap(ArchiverManager.class)is empty. Cause:DefaultArchiverManager(plexus-archiversrc/main/java/org/codehaus/plexus/archiver/manager/DefaultArchiverManager.java) is ajavax.inject@Named @Singletonbean whose constructor takesMap<String, Provider<Archiver>>etc., a Sisu-only hint-keyed map, and Maven 4 registersjavax.inject@Named("hint")beans by class name (next item).lookupMap(Archiver.class)does list the archivers, keyed by class name (org.codehaus.plexus.archiver.zip.ZipArchiver), so hintzipis unavailable. plexus-archiver master (5.0.0-SNAPSHOT) already hasnew ServiceLoaderArchiverManager()(no DI,META-INF/services/org.codehaus.plexus.archivers.spi.ArchiverProvider), and the plugin uses it. But archivers it creates still NPE inaddArchivedFileSet(unpacking, every<unpack>true):AbstractArchiver.java:132declares@Inject private Provider<ArchiverManager> archiverManagerProvider(used at:589inasResourceCollection, reached fromaddArchivedFileSet:646); with no container it stays null. Same NPE for archivers taken fromlookupMapand fornew ZipArchiver(). 4.14.0 has the same field (AbstractArchiver.java:144, use at:673) and noServiceLoaderArchiverManager, so the 4.x line cannot be made Sisu-free without a backport. Candidate fix PR for codehaus-plexus/plexus-archiver (master): makeasResourceCollectionfall back tonew ServiceLoaderArchiverManager()when the provider is null (4 lines,asm-plexus-archiver-prototype.diff; with itaddArchivedFileSetworks and all 155 ITs' unpacking passes); better, let the ServiceLoader providers/ArchiverFactoryhand the manager to the archivers they create, and add a test that unpacks throughnew ServiceLoaderArchiverManager().javax.inject@Named("hint")beans lose their hint in a Maven 4 plugin. Probe: a@javax.inject.Named("sisu-h")Handleris inlookupMap(Handler.class)underprobe.SisuHandler,lookup(Handler.class, "sisu-h")fails;@org.apache.maven.api.di.Named("di-h")andMETA-INF/plexus/components.xmlrole-hints work. The same applies to core'sComponentConfigurators (keyedorg.codehaus.plexus.component.configurator.BasicComponentConfigurator). Consequence for the SPI: third-partyContainerDescriptorHandlers declared withjavax.inject.@Named("hint")cannot be selected by<handlerName>hint</handlerName>any more; components.xml orapi.di.@Namedones can. The built-in handlers (file-aggregator,metaInf-services,metaInf-spring,plexus) moved toapi.di.@Named. Handlers are looked up throughLookup.lookupMap(ContainerDescriptorHandler.class)at use time.new BasicComponentConfigurator()in the plugin realm:NoClassDefFoundError: com.google.inject.spi.TypeConverter; obtaining it fromLookup.lookupMap(ComponentConfigurator.class)fails the same way on provisioning (ITmassembly-345,archiverConfig). Replaced byinternal.BeanConfigurator(setter or field per child element; String, numbers, boolean, enum,File,Path, collections/arrays of those,-to camelCase). Anything the Plexus converters did beyond that (for example nested objects) is not supported forarchiverConfigand handler<configuration>; unverified for exotic archiver options.PlexusConfiguration archiverConfigandXpp3Domfail in v4 ("Cannot create instance of ...");archiverConfigis nowXmlNode, its XML text is handed to the archiver configuration as before. Descriptor modelXpp3Domfields (handler<configuration>) are unaffected (they are read by modello, not by the mojo configurator).${project.basedir}default is wrong in a reactor: it resolved to the directory Maven was started in, not the child's (11 dependency-set ITs failed with "Error locating assembly descriptor"). Thebasedirparameter is gone; the value comes from the injectedProject.DependencyResolverRequestneeds a non-nullpathScope;RESOLVEonly returns dependencies with a path type, sopom/zip/sardependencies would be dropped. The plugin usesCOLLECTwith the project's direct dependencies (pre-filtered by scope asclasspathFilterdid), managed dependencies and project repositories, walks theNodetree itself, and resolves each artifact withSession#resolveArtifact(artifact, projectRepositories)(without the repositories ITmassembly-1306fails: the session's repositories are not the project's).scope=testneeds two collects (TEST_COMPILEandTEST_RUNTIME) to cover compile, provided, runtime and test;systemscope rides onMAIN_COMPILE.Nodehas no parent link, so the dependency trail is rebuilt during the walk.useTransitiveFiltering/ cafactTransitively: maven-common-artifact-filters 4 droppedactTransitivelyand the trail (PatternIncludesArtifactFilter(patterns, boolean)), so the flag would silently do nothing.FilterUtilsre-creates it in two private subclasses: the artifact is tried, then every trail element (project, ancestors) until a pattern matches;patternMatchescannot tell "no match" from "negated pattern matched", so a second filter with a trailing catch-all*is asked as well. Works, but leans on caf's first-match-wins behaviour and on the protectedpatternMatches; aPredicate<Dependency>with a real trail (or the flag back) in caf would be cleaner. Tests cover include/exclude via trail.MavenProjectfor every dependency (and a stubMavenProject(Model)when that failed). v4 hasProjectBuilder.build(request)from a POM file (the POM is resolved first) but no way to create a stubProject; on failure the plugin continues with no project and uses the artifact itself for${artifact.*}(one IT,including-sar-dependency, hit that path: the sar's POM does not build).ProjectBuilderRequesthas no builder switch forallowStubModel/validation level (v3 used minimal validation), so POMs v3 tolerated may now fail to build and lose${artifact.build.finalName}/${artifact.properties.x}.${project.*},${module.*},${artifact.*}(descriptors, archiverConfig, filtering): v3 reflected overMavenProject; v4Projecthas no bean surface (getBasedir()is aPath, nogetBuild()bean tree beyond the model). The plugin evaluates against the effectiveModelplusbasedir,file,id. Not reproduced:${project.artifact.*},${project.attachedArtifacts},${project.compileSourceRoots},${project.artifacts}style paths. Unverified how many real descriptors use them.Project#getMainArtifact()is empty for pom packaging andArtifactManager#getPathis the only way to a file; pom-packaged projects are treated as having no file (as v3), otherwiseuseProjectArtifactadded the POM to the archive (ITmassembly-1022). Attachment files come fromArtifactManager, attachments are created withSession#createProducedArtifact(..., classifier, extension, null)plusProjectManager#attachArtifact(project, artifact, path); theattachArtifact(session, project, type, path)default has no classifier parameter. Replacing the main artifact file (appendAssemblyId=false) usesSession#setArtifactPath.@Mojohas nothreadSafeand norequiresDependencyResolutionattribute (onlydependencyResolutionPathScopes, unused): resolution happens inside the mojo, and the plugin is not marked thread-safe.maven-plugin-tools4.0.0-beta-3 constructor injection of a mojo is not possible (field@Inject).BuildContext(plexus-build-api) is not bound in the CLI; it is looked up optionally and skipped when absent (it only refreshed the archive for IDEs).Archiverinterface (removed deprecated methods), soAssemblyProxyArchiver(939 lines, implementsArchiver) had to drop the implementations of the removed methods; it still compiles against 4.14.0 only because theArchivermethods it no longer implements would be abstract there, i.e. it does not.Removed or changed tests (nothing else deleted)
FilterUtilsTest.filterProjectsShouldNotRemoveProjectTransitivelyIncludedandfilterProjectsShouldRemoveProjectTransitivelyExcluded: a reactor project's main artifact has no dependency trail in production (v3 or v4); the tests passed only because the mock returned one.ModuleSetAssemblyPhaseTest.getModuleProjectsShouldExcludeModuleAndDescendentsTransitively: same reason, it relied on a mockedgetDependencyTrail().DefaultDependencyResolverTestrewritten for the v4 resolver (mockedDependencyResolver/Session),AddDependencySetsTaskTestfor the v4ProjectBuilder; one test added (getDependencySetResolutionRequirementsFiltersByScope). Test projects/sessions/artifacts are Mockito stubs in the newtestutils/TestStubs.User-visible changes
basedir,reactorProjects,mavenSession(all readonly).archiverConfigis now anXmlNode(same XML).<archive>is the maven-archiver 4MavenArchiveConfiguration(manifestFileis resolved as aPath).ContainerDescriptorHandlers registered withjavax.inject.@Named("hint")are not found by hint (see Gaps).useTransitiveFilteringbehaviour is preserved by plugin code, not by the library.${project.artifact...}-style expressions may differ (see Gaps).Improvements: drops
javax.inject,sisu-maven-plugin(Sisu index),maven-plugin-api,maven-core,maven-model,maven-model-builder,maven-artifact,maven-resolver-api/util,maven-plugin-annotations; addsmaven-api-core,maven-api-di,maven-api-model,maven-api-xml,maven-api-annotations(provided).org.eclipse.sisu.plexusstays provided only for theExpressionEvaluatorinterface,plexus-build-apionly for the optionalBuildContexttype. No new runtime dependency. The Plexus configurator, the PlexusContainer lookup and the reflection overMavenProjectare gone.Recommendation: port for the Maven 4 line once plexus-archiver ships the no-DI unpack fix (first Gap item); until then the plugin depends on an unreleased 5.0.0 and on a patch. Two upstream asks that would remove most hacks: (1) plexus-archiver: unpack without a JSR-330 container, and a released
ServiceLoaderArchiverManager; (2) Maven core: honourjavax.inject.@Namedhints (or document that onlyapi.di.@Namedand components.xml keep them), and fix${project.basedir}in a reactor. Keep 3.x for Maven 3.maven-changelog-plugin: blocked
Branch
agent/mvn4-api; PR not opened yet. Status: blocked, 4.0.0-beta-1-SNAPSHOT, Java 17. The plugin code ports and compiles; it cannot run, because every consumer of a report mojo is a Maven 3 class.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifybefore β 23 tests, 0 failures. After β 23 tests, 19 errors, 0 failures (ChangeLogReportTest15,DeveloperActivityReportTest2,FileActivityReportTest2); the 4 tests that pass do not execute a report.-Prun-itsbefore β 4/4 ITs pass; after β 0/4 (whole suite, no time-box hit). Spotless clean. No test deleted.Concrete build errors (reporting chain)
maven-reporting-impl4.0.0, with only Maven 4 API dependencies:cannot access org.apache.maven.plugin.AbstractMojoatChangeLogReport extends AbstractMavenReport. The released base class extends the Maven 3AbstractMojo.maven-reporting-impl5.0.0-SNAPSHOT port (see below): compiles, but every unit test that executes a report fails withIllegalStateException: Cannot get the Maven 3 object from org.apache.maven.impl.InternalSession...#getMavenSession(). The portedAbstractMavenReport.execute()reaches the Plexus container throughLegacyMavenBridgeandSession.getMavenSession(). The impl port's own ITs fail the same way at runtime withA required class was missing ... org/apache/maven/execution/MavenSession:maven-coreis not visible in a plugin class realm.Failed to get report for org.apache.maven.plugins:maven-changelog-plugin: Unable to lookup Mojo: Cannot cast org.apache.maven.plugins.changelog.ChangeLogReport[Factory] to org.apache.maven.plugin.Mojo. Site plugin 3.x only accepts Maven 3 mojos as reports.Snapshots consumed:
maven-reporting-impl5.0.0-SNAPSHOT, built frommaven-reporting-implagent/mvn4-api(mvn install -DskipTests -Dinvoker.skip=true, installed into the local repository);maven-reporting-api4.0.0 (release).User-visible changes
<prerequisites>followsmavenVersion.changelog,dev-activity,file-activity.developers:List<org.apache.maven.model.Developer>βList<org.apache.maven.api.model.Developer>. Theproject.developersexpression default is gone (the Maven 4 test container cannot evaluate an expression to a rawList); when unset, the mojo readsproject.getModel().getDevelopers(). The v4Developeris immutable, so a POM-level<developers>override in plugin configuration is no longer expressible as before. Not verified under a real build because of the block above.settingsparameter (${settings}) removed; credentials come fromSession.getSettings().getServers(), matched onhost[:port]. Users who passed aSettingsobject in test configurations lose that hook.ScmManageris a Plexus component and v4 DI reportsNo binding to construct an instance for key ScmManager(seen in both unit tests and the first IT run). The mojo now obtains it withLookup.lookup(ScmManager.class)on first use; that path is unexercised in a real build because of error 3.MojoExecutionExceptionno longer thrown (MojoException);ChangeLogReport.checkResultis public and now declaresMojoException.maven-impl, Guice and Mockito 5; resolver 1.9.27 β 2.0.23; transportmaven-resolver-transport-httpβ-apache.Gaps
MavenSession, which is not exported.ScmManager);Lookupis the workaround.Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-settings,maven-plugin-annotations,javax.injectandmaven-artifact(test) from the plugin's own dependencies.Recommendation: do not merge. Keep on 3.x until maven-site-plugin, maven-reporting-impl and doxia-sitetools have v4 releases in that order; then the remaining work here is the test-harness glue (
Lookup,Sessionsettings) and re-running the 4 ITs. The commit is a compile-clean starting point only.maven-checkstyle-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17. Thecheckgoal is ported and runs in a real Maven 4.0.0-rc-7 build (30 ITs). The two report goals (checkstyle,checkstyle-aggregate) are blocked by the reporting chain and are excluded from the build; their sources stay in the tree.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn -B -ntp verifybefore β 26 tests, 0 failures, 1 skipped; after β 16 tests, 0 failures, 0 skipped (CheckstyleReportTest10 run / 1 skipped removed with the reports; every other test kept:CheckstyleViolationCheckMojoTest6,RuleUtilTest4,CheckstyleResultsTest2,CheckstyleExecutorTest1, bothCheckstyleReportListener*Test1,ViolationTest1).-Prun-itsbefore β 49/49 invoker ITs pass (24 min); after β 30/30 of the ITs that do not need a report goal pass (clean verify -Prun-its, 4:48 min); the other 19 are excluded withpomExcludes(list under Gaps). Run unexcluded, the suite was 27 of 49 on the first pass (fixes for the 3 inline-rules ITs applied afterwards, then 30 of 30). Spotless clean.dependency:analyzeclean.Report goals: can they be ported? No, not today. Concrete errors:
AbstractCheckstyleReportagainst Maven 4 API + releasedmaven-reporting-impl4.0.0:AbstractCheckstyleReport.java:[64,56] cannot access org.apache.maven.plugin.AbstractMojo(the released base class extends the Maven 3AbstractMojo, which is not on a v4-only classpath).reporting-impl(the 5.0.0-SNAPSHOT port), site plugin 3.x on rc-7 only accepts Maven 3 mojos as reports:Unable to lookup Mojo: Cannot cast org.apache.maven.plugins.changelog.ChangeLogReport[Factory] to org.apache.maven.plugin.Mojo(proven on maven-changelog-plugin, same chain, not re-run here). The port would also needmaven-coretypes from reporting-impl at runtime (MavenSession), which a plugin realm cannot see.CheckstyleReportRenderer, 696 lines),MavenProjectandMavenReportException; all of that has to move with the chain (doxia-sitetools β site plugin β reporting-impl).Excluded from compilation:
AbstractCheckstyleReport,CheckstyleReport,CheckstyleAggregateReport,CheckstyleReportRenderer(compilerexcludesin the pom; sources kept).Non-report goal
check: mojo implementsorg.apache.maven.api.plugin.Mojo; injectedSession,Project,MojoExecution,Logand the executor (@Inject @Named("default"), field injection because mojo constructor injection fails in rc-7).MojoExecutionException/MojoFailureExceptionbecomeMojoException.DefaultCheckstyleExecutor):@Named("default")withorg.apache.maven.api.di, no Sisu@Typed; the DI index is generated by the annotation processor (META-INF/maven/org.apache.maven.api.di.Injectlists the mojo factory and the executor).ProjectManager.getEnabledSourceRoots(project, scope, Language.JAVA_FAMILY); resources: the same call withLanguage.RESOURCES, turned intoorg.apache.maven.api.model.Resource. New helperexec/ProjectRoots.${plugin}PluginDescriptor.getArtifactMap()in v3):MojoExecution.getPlugin().getDependenciesMap()plusArtifactManager.getPath(Dependency); proven by ITsMCHECKSTYLE-225-customHeader,-225-pluginManagement,-225-LICENSE.txt,-219-*(license read from a plugin-dependency jar).project.getTestClasspathElements()in v3):Session.resolveDependencies(project, PathScope.TEST_COMPILE | MAIN_COMPILE)plus the output directories. A resolution failure logs a warning and continues with the output directories only (v3 withrequiresDependencyResolution=NONEnever failed here).plexus-resources without Sisu (how
ResourceManagerwas obtained)DefaultCheckstyleExecutorandLicenseResourceManagerno longer getResourceManager/Map<String,ResourceLoader>injected. plexus-resources 1.4.0 is a Sisu component library but its classes are plain:javapofplexus-resources-1.4.0.jarshowsDefaultResourceManagerhaspublic DefaultResourceManager(Map<String,ResourceLoader>)andFileResourceLoader,JarResourceLoader,URLResourceLoader,ThreadContextClasspathResourceLoaderall have public no-arg constructors. Their@javax.inject.Namedvalues (read from the class files) arefile(FileResourceLoader.ID),jar,url,classloader. The executor buildsnew LinkedHashMapwith those four and passes it tonew DefaultResourceManager(map)ornew LicenseResourceManager(map). The loaders keep search paths, so everyexecuteCheckstylecall builds fresh instances (the v3 singleton managers were reconfigured on every call). NoLookup, no Sisu, no@Named("license")binding.LicenseResourceManagerkeeps itsinstanceof ThreadContextClasspathResourceLoaderfilter (MCHECKSTYLE-219), which works because the loader class is unchanged.User-visible changes
checkandhelponly.checkstyle:checkstyleandcheckstyle:checkstyle-aggregateare gone until the reporting chain is ported;<reporting>entries andcheckstyle:checkstyle checkstyle:checkcommand lines break.checkparameters unchanged, except:resourcesandtestResources(read-only,${project.resources}) and the injectedproject/pluginparameters are no longer parameters;checkstyleRulesisorg.apache.maven.api.xml.XmlNodeinstead ofPlexusConfiguration;threadSafehas no v4 attribute.MojoFailureExceptiontype: a violation failure and an execution failure are bothMojoException(message unchanged; build result is FAILURE either way).checkstyleRulesinline config: Maven 4.0.0-rc-7 drops all attributes when it injects anXmlNodeparameter (-Xshows the configuration with<module name="Checker">and(f) checkstyleRules = <module>...withoutname;inlinerules,MCHECKSTYLE-295,-371fail withAttribute "name" is required ... for element type "module"). The mojo reads the node fromMojoExecution.getConfiguration()instead, and writes it withXmlService.write(XmlNode.toString()is not XML). Consequence:${...}expressions inside the inline rules are not evaluated (they were not withPlexusConfigurationeither).checkon a module whose dependencies cannot be resolved warns instead of silently using only the output directories.maven-impl,maven-core,maven-xml, Guice 6; test configs use${project.basedir}(the harness does not evaluate${basedir}); slf4j 1.7.36 β 2.0.19; resolver test dependencies dropped.MCHECKSTYLE-131,inlinerules,multi-modules,multimoduleprojectranclean checkstyle:checkstyle checkstyle:check; nowclean checkstyle:check(checkruns the analysis itself). Their assertions are unchanged and pass.Gaps
run-itsprofile because they callcheckstyle:checkstyle,site, or bind thecheckstylegoal:MCHECKSTYLE-137,-172,-193,-222-no-resources,-222-resources,-222-testResources,-224,-253-jdk8,-332_cache-checker,-338,-357,-357-with-header-override,-365,-99,-99-custom-xref-test-location,checkstyle-goal,checkstyle-report,minimal-pom,multi-modules-aggregate. Not deleted; they pass again when the report goals return. Their failure on the ported plugin isCould not find goal 'checkstyle' in plugin ...:maven-checkstyle-plugin:4.0.0-beta-1-SNAPSHOT among available goals check, help.XmlNodeparameter injection loses attributes in Maven 4.0.0-rc-7 (workaround above; a core issue).org.apache.maven.api.model.Resourceis deprecated in rc-7 (javac warning) in favour ofSourceRoot; kept because the executor request andaddResourceFilesToProcessonly need directory, includes and excludes.Plugin.getArtifactMap()for transitive plugin-realm artifacts;getDependenciesMap()covers the direct<dependencies>of the plugin, which is what v3 code looked up.Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-artifact,maven-plugin-annotations,javax.inject,org.eclipse.sisu.plexus,org.eclipse.sisu.inject,sisu-maven-plugin,animal-sniffer-maven-plugin(Java 8 signature),maven-reporting-api/-impl,doxia-core/-sink-api/-integration-toolsandplexus-i18nfrom the plugin's own dependencies; resource managers are no longer singletons with shared search paths.Recommendation: do not merge.
checkis a usable starting point and keeps everycheckIT green on rc-7. Keep the plugin on 3.x until maven-site-plugin, maven-reporting-impl and doxia-sitetools have v4 releases in that order; then restore the four report classes (portMavenProjecttoProject,MavenReportExceptionto the v4 report contract) and re-enable the 19 ITs. Separately worth filing against Maven core: theXmlNodeattribute loss.maven-dependency-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17. 25 of 29 goals ship and run on Maven 4.0.0-rc-7;add,remove,list-repositoriesandanalyze-reportare not shipped.Rebased 2026-10-06 onto master. The
treegoal now ports MDEP-969 (apache/maven-dependency-plugin#1712) and collects throughDependencyResolver.collect, so it no longer uses the maven-dependency-tree 4.0.0-SNAPSHOT; the POM still declares that dependency. The verbose scope-selector fixes from #1712 and #1716 are not ported: they configure Resolver'sConflictResolver, which the Maven 4 API does not expose (see Gaps). MDEP-803 and MDEP-971 are carried. Unit tests: 177 run, 0 failed; ITs not rerun.Verified locally:
mvn verify, Maven 4.0.0-rc-7, JDK 21. Unit tests before 435 run, 0 failed, 1 skipped; after 174 run, 0 failed, 0 skipped (accounting under Gaps). spotless:check, checkstyle, RAT, enforcer and the plugin's ownanalyze-only(strict) pass. ITs (-Prun-its -Dinvoker.test=subset, only ported goals, 30 min time-box): before, 75 builds, 74 passed, 1 failed (unpack-custom-ear, fails on the unchanged tree;purge-local-repository-bad-pomfailed once and passed on rerun) in 1534 s; plus 19 more, 18 passed, 0 failed, 1 skipped (analyze-exclusions-gh-1598, the IT excludes Maven 4 itself) in 236 s. After, 94 builds: 85 passed, 8 failed, 1 skipped (582 s), thenmdep-450-*rerun after a fix, 2 of 2 passed. The 8 failures:unpack-custom-ear(same as before),analyze-report,analyze-testDependencyWithNonTestScope,list-repositories(goals not shipped),tree-verbose,tree-verbose-small,used-dependencies,mdep-450-project-with-ancestor(fixed after that run). IT subset: analyze*, build-classpath*, collect, copy*, filterunpack, get-, mdep-4xx..9xx for ported goals, purge-local-repository, resolve*, go-offline*, tree*, unpack*, used-dependencies, dependency-properties, list-repositories, analyze-report. Not run: add-dependency, remove-dependency, setup-custom-ear-lifecycle.Shared snapshots consumed (built from the local branch agent/mvn4-api, commit "Port to the Maven 4 API"): maven-dependency-tree 4.0.0-SNAPSHOT a610f3b1ab9e01de142ae84b4363fcaa1db4ac50; maven-dependency-analyzer 2.0.0-SNAPSHOT f10337cef52a2366f4c46a685bef853a31d5484f; maven-common-artifact-filters 4.0.0-SNAPSHOT c2fdc406acfb36807bf1dd1f31eeecee510bb40f. Experiment only, not a dependency of the result: maven-reporting-impl 5.0.0-SNAPSHOT 21c3da415d7ebcf965f2dc1e1c101164220cdb74. plexus-archiver stays the released 4.14.0; its
ArchiverManageris a Sisu component that a v4 mojo cannot have injected and theLookupservice does not find in the plugin realm, soUnpackUtilbuildsDefaultArchiverManagerby hand from theUnArchiverentries of plexus-archiver'sMETA-INF/sisu/javax.inject.Named(new compile dependencyjavax.inject:javax.inject:1forProvider/Named).Per-goal table
baseDir,outputDirectoryremoved (${basedir}does not evaluate).analyzeforks via@Execute(phase="test-compile"); the forked build does not leave reactor siblings resolvable, soused-dependencies(multi-module) failsInputLocation(present onProject.getModel()); only exercised by hand, its IT skips Maven 4org.apache.maven.execution.MavenSessionnot found in the v4 plugin realm; with maven-core added, "A type incompatibility occurred" (two copies of core classes). Reporting chain, not plugin codeBuildContext(m2e) gone:skipDuringIncrementalBuildaccepted, no effectDependencyResolver.flatten(no download); "sources" classifier fixed at run time (no@Parameteron setters)ProjectManagerdefault-cli; relocation/descriptor as above<dependencies>scope and exclusions cannot reach the v4 request (resolved as compile, no exclusions)TemplateArtifactbean with the Maven 3 gettersRemoteRepositoryhas no mirrored-repositories or policy; IT expects "mirrored by" and "releases+snapshots"syncInMemoryModel); not attempted,pom/DependencyEntrykeptPublic API changes
org.apache.maven.api.plugin.Mojo,@Injectfields, uncheckedMojoException; Maven 3Artifactreplaced byResolvedDependency(new, path + coordinates) andapi.Dependency;ResolverUtil,CopyUtil,UnpackUtilare plain classes, not components;ArtifactItem.getArtifact()returnsDownloadedDependency; filters/markers/translators takeDependency;DependencyUtilgainsgetId,toString,getDependencyConflictId.Gaps
Session.resolveArtifact), pre-order artifact order,Project.getParent()empty for repository parents, purge root-dependency scope semantics.@Mojo(dependencyCollection = true), sorequiresDependencyCollectionis dropped;requiresDependencyResolution,threadSafehave no v4 attribute (resolved inside the mojo).mojo()removed), ResolverUtilTest (22 to 18, descriptor/installer/collect cases rewritten for the v4 calls), pom/* (58, domtrip test scope); new ResolvedDependencyTest (4), TreeSerializationTest (5, replaces TestTreeMojo, whose mojo-discovery case is removed). Not compiled (files remain, excluded bytestIncludes, Maven 3 harness withMavenProject/MavenSessionstubs; ITs cover the goals): AddDependencyMojoTest 36, RemoveDependencyMojoTest 12, AnalyzeExclusionsMojoTest 9, GoOfflineMojoTest 9, ResolveDependenciesMojoTest 4, TestAnalyzeDuplicateMojo 2, TestBuildClasspathMojo 2, TestCollectMojo 3, TestCopyDependenciesMojo 35 + 2: 14, TestCopyMojo 29, TestGetMojo 8, TestIncludeExcludeUnpackDependenciesMojo 7, TestIncludeExcludeUnpackMojo 11, TestListClassesMojo 4, TestPropertiesMojo 2, TestRenderDependenciesMojo 2, TestResolveMojo 2, TestSkip 19, TestTreeMojo 6, TestUnpackDependenciesMojo 27 + 2: 5, TestUnpackMojo 17.User-visible changes
add,remove,list-repositories,analyze-reportabsent. ParametersbaseDir,outputDirectory(analyze) removed;skipDuringIncrementalBuildno-op;render-dependenciestemplates keep Maven 3 getters; tree verbose annotations differ;dependency:analyzeon a multi-module reactor needs siblings already built (useanalyze-onlyin the lifecycle).Improvements: drops maven-core, maven-plugin-api, maven-model, maven-artifact, maven-settings, maven-repository-metadata, maven-resolver-, plexus-build-api, sisu.plexus, plexus-i18n, maven-shared-utils, javax.inject annotations build; test side drops jetty and plugin-testing-harness. Adds maven-api-, three shared snapshots,
javax.inject, slf4j-api (provided).Recommendation: ship the ported goals on the Maven 4 line, keep 3.x for Maven 3. Before a real PR: fix the dependency-tree verbose data, decide
@Executereactor behaviour upstream in Maven, file a plugin-tools issue fordependencyCollection, and port add/remove (route exists, unattempted).slachiewicz commentedon Sep 30, 2026
Wave 4 findings, part 2 of 4: maven-doap-plugin to maven-jarsigner-plugin, then maven-site-plugin
Each plugin is a local branch
agent/mvn4-apiwith a "Build with Maven 4 only" commit and a "Port to the Maven 4 API" commit; the PRs are not opened yet.maven-doap-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17. Five approximations, all under Gaps; the release listing and theartifactparameter differ from Maven 3 behaviour in ways the unit tests cannot show.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 15 tests before and after, 0 failures, 0 skipped;mvn verify -Prun-itsβ 4 of 4 ITs pass before and after;spotless:checkclean. Smoke runs on rc-7 against Maven Central (scratch projects, not committed): a project whose releases exist on Central (release list,file-releaseURLs andcreateddate came out right) and<artifact>set toorg.apache.maven:maven-artifact:3.9.9(parent inherited, URL and SCM effective). The pre-port plugin could not be compared on the same projects: under rc-7 it fails withNoClassDefFoundError: org/codehaus/plexus/util/xml/XmlStreamReaderas soon as a repository returns metadata, which none of the ITs do.Public API changes
DoapMojoimplementsorg.apache.maven.api.plugin.Mojo,@Mojo(name = "generate")fromorg.apache.maven.api.plugin.annotations;execute()throwsMojoException.projectis the injectedorg.apache.maven.api.Project, dates and model getters read fromproject.getModel().localRepository,projectBuildingRepositories,remoteRepositories,repositorySystemSession,settings,project(as a parameter).DoapUtil.interpolate(String, Project, Settings)takes the v4Projectandorg.apache.maven.api.settings.Settings.DoapUtil.getContributorsWith*Role(List<Contributor>)lose theI18Nargument and useorg.apache.maven.api.model.Contributor.ASFExtOptionsUtil.isASFProject(Project)andfindChair/findPMCMemberstakeorg.apache.maven.api.model.Developer.DoapOptions,ASFExtOptions,ExtOptions,DoapArtifact) are unchanged.Gaps (rc-7
maven-api-core,maven-api-model,maven-api-settings)Projectfrom coordinates: the v4ProjectBuildertakes a path or aSource, not an artifact.<artifact>now resolves the POM withSession.resolveArtifactand builds from its path. A build from aSource(Sources.resolvedSource) returns an emptyOptional<Project>with no problems listed, becauseDefaultSession.getProjectdrops a project without base directory; the plugin used it first and silently fell back to the current project. The request builder has no validation level, so Maven 3'sVALIDATION_LEVEL_MINIMALis gone.RemoteRepositoryhas no release or snapshot policy (getId,getType,getUrl,getProtocolonly). The plugin picks the first repository that serves releases but not snapshots; it now reads the policies from the repository of the same id inproject.getModel().getRepositories(). A repository that is not declared there, such as a mirror or one fromsettings.xml, is taken as releases only, which can change which repository is chosen.Transport(fromTransportProvider) fetchesg/a/maven-metadata.xmlby relative URI, and the XML is parsed withMetadataStaxReader, which ships inmaven-support, not in an API module; it is bundled, as maven-jar-plugin does. Lost: the update and checksum policy, the local copy of the metadata, and the distinction resolver makes between a missing file and a failed transfer beyondOptional.empty().Transporthas no existence check. Whether a release file exists is now read from its.sha1, so a repository that serves artifacts without checksum files reports nofile-release. The alternative was downloading every artifact of every version.Session.getPathForRemoteArtifactis the path in the local cache, not in the remote repository. The default-layout location is built by hand (g/a/v/a-v[-c].ext); the extension comes fromsession.requireType(type).getExtension(), or the type itself when unknown, as the old handler manager did.ScmManagerandI18Nare Plexus components with no v4 injection.ScmManageris now aBasicScmManagerholding onlySvnExeScmProvider, the same provider set the old classpath had;I18Nis replaced byResourceBundle.getBundle("doap-person").${project.reporting.outputDirectory}is empty in Maven 4 unless the POM sets it (Maven 3 always gave${project.build.directory}/site); the plugin applies that default itself. ThebasicIT caught it as an NPE.Metadata.getVersioning().getVersions()is immutable; the old code reversed it in place. The unit fixture had one version, which hid the failure until the real run.ProjectManagerhas no DI binding in rc-7;ProjectBuilderandTransportProviderare bound, but their implementations cannot be built in the test harness (DefaultTransportProviderneeds resolver'sTransporterProvider). All three are looked up withsession.getService(...).projectandpomprefixes now resolve against the effectiveModel(getter names match forname,url,scm.*,developers[n].*);basediris added by hand. Anything that onlyMavenProjecthad (${project.artifact...},${project.file}) no longer resolves.maven-plugin-testing-harness4.0.0-beta-4 has no real repository session (3.5.1 hadrealRepositorySession = true), so the two tests that resolved plexus-utils 1.5.5 and xstream 1.1 from Central now use fixture POMs (src/test/resources/unit/artifact, reduced by hand) and a mockedSession/ProjectBuilder, and the release tests use a directory-backed fakeTransport. The real resolution path is covered only by the smoke run above, not by a committed test.User-visible changes
<prerequisites>followsmavenVersion. Thegenerategoal and its writable parameters keep their names.<artifact>builds a model with Maven 4's default POM validation instead of minimal validation..github/workflows/maven-verify.ymlstill carries the JDK 8 / Maven 3.9.0matrix-includeentry, which cannot run a Maven 4 plugin; not touched.Improvements: drops
maven-plugin-api,maven-core,maven-artifact,maven-settings,maven-model,maven-model-builder,maven-repository-metadata,maven-resolver-api/impl/spi,maven-scm-manager-plexus,plexus-i18n,javax.injectand the resolver test connectors;XmlStreamReaderis no longer needed on the release path.Recommendation: port, and ask apache/maven for four things: a policy accessor on
RemoteRepository, an existence check onTransport, aMetadataread service, andProjectBuilderby coordinates that returns aProjectfor a repository POM. Until then a plugin that lists releases is the kind that loses most by moving. Release it as a 4.x line next to the 3.x one.maven-ear-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT (was 3.4.1-SNAPSHOT), Java 17.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verify-> 48 unit tests before (8 classes) and 49 after, 0 failures/errors/skipped (one test added, see Tests).mvn verify -Prun-its-> before: 18/18 invoker ITs and 103/103EarMojoITpass (45 min, run with other builds in parallel); after: 17/18 invoker ITs pass and 103/103EarMojoITpass (13 min). The one failing IT isskinny-wars-timestamp(see Gaps); the before run is the 3.4.1 plugin under Maven 4.spotless:checkclean. Released artifacts: maven-archiver 4.0.0-beta-5, maven-filtering 4.0.0-beta-1, plugin-tools 4.0.0-beta-1. Local snapshot consumed: maven-mapping 4.0.0-SNAPSHOT (agent/mvn4-apiat 1f0a2fa, worktreewt-fbf-dep-mapping,mvn install -DskipTests).User-visible changes
maven-plugin-api,maven-core,maven-artifact,javax.inject,maven-shared-utils). A 3.x line has to stay for Maven 3 builds.earandgenerate-application-xml, their phases and every parameter name are unchanged;threadSafeis no longer declared (v4@Mojohas no such attribute), norrequiresDependencyResolution(the plugin resolvesPathScope.TEST_RUNTIMEitself throughDependencyResolver).earSourceDirectorydefault is${project.basedir}/src/main/application(${basedir}is not evaluated in v4, the directory was silently ignored), and thedescriptiondefault is${project.model.description}.@{version}@(the defaultoutputFileNameMapping) of a SNAPSHOT dependency expands to1.0-SNAPSHOT, no longer to the timestamped1.0-20150825.210557-91; the documented "timestamp postfix" in customize-file-name-mapping is not reproducible (see Gaps). EAR entry names and the Class-Path of skinny modules change accordingly for SNAPSHOT dependencies.outputFileNameMapping): the documented ones (groupId,artifactId,version,baseVersion,dashClassifier?,extension) are unaffected. The v4 port drops theArtifactHandlervalue source andapi.Artifacthas notype/scope; because the plugin passes theDependency,@{type}@now prints theTypeobject'stoString()(notejb) and@{scope}@printsCOMPILE(notcompile), and@{packaging}@,@{language}@,@{file}@stay literal in the file name. None of these is documented or used in the repo's poms/ITs.artifactTypeMappings,jboss,security,envEntries,ejbRefs,resourceRefsareXmlNodeinstead ofPlexusConfiguration; the XML users write is unchanged.Dependency.getType().id()is the declared string (ejb,war,rar,sar,har,par,wsr,app-client,ejb-client,test-jar,jboss-sar/-har/-par, custom types throughartifactTypeMappings), so the type to module mapping works and is covered by 103EarMojoITprojects.ejb,ejb-client,war,ear,test-jarare registered types in rc-7; the rest fall back to the legacy handler (extension = type) and resolve fine. The v4Typereplaces theArtifactHandlerforincludesDependencies/extension only; the ear-specific mapping (EarModuleFactory,ArtifactTypeMappingService) stays in the plugin, nothing in v4 replaces it.EarModule.getArtifact()returns the newutil.ResolvedArtifact(dependency + resolvedPath; v4Dependencycarries no file) instead ofArtifact; module constructors,ArtifactRepository,EarExecutionContextfollow;resolveArtifactno longer throws the checkedMojoFailureException,InvalidJavaEEVersionextends the uncheckedMojoException;ArtifactTypeMappingService.configuretakes the newutil.XmlConfig(a read-only view overXmlNode);EarMavenArchiver.getManifesttakesapi.Session/Projectand the deprecatedgetManifest(MavenProject, config)overload is removed;EarMojohas no constructor (archivers are created inside;ArchiverManagerreplaced bynew ZipUnArchiver()).Providers(@ProvidesProjectManager,BuildContext) forMavenFileFilter; the ear artifact is attached withProjectManager.attachArtifact(project, project.getMainArtifact(), ear)or a produced artifact of typeearfor a classifier.Gaps
skinny-wars-timestampIT fails (only after-failure): v4 gives the resolved SNAPSHOTDependencyversion1.0-SNAPSHOTand a-SNAPSHOTlocal-repo file name;session.resolveArtifactreturns the same. The timestamped version is unreachable through the API, so the IT's expectations (eartest-jar-sample-one-1.0-20150825.210557-91.jarin Class-Path, timestamped jar removed from the WAR built by the 3.x war plugin) cannot hold. With a v4 war plugin both sides use-SNAPSHOTand the original-file-name lookup matches; only mixed 3.x-war/4.x-ear builds leave the duplicate jar inWEB-INF/lib. IT left red on purpose, not edited.DependencyResolverignoresType.isIncludesDependencies()(war,ear,rar) although the session hasFatArtifactTraverser: the war's transitives appear in the result, and an artifact reachable by several paths is listed only below the nearest one (skinny-wars-javaee5andproject-089..096failed with it). Worked around inAbstractEarMojo.resolveProjectArtifacts: a RESOLVE tree plus a verbose COLLECT tree; an artifact is kept only if reachable without passing through anincludesDependenciesnode (a reachable winner's subtree counts). Approximation: a version conflict won by the fat path is not re-mediated.XmlNodemojo parameters lose XML attributes (DefaultBeanConfigurator.XmlConverterbuilds the node withnullattributes; same on core master):artifactTypeMapping type= mapping=,security-role id,loader-repository class. Worked around by reading those elements from the injectedMojoExecution.getConfiguration()(modelXmlNode, attributes intact); values are model-interpolated only,${session.*}-style expressions are not evaluated.PlexusConfigurationparameters cannot work at all ("Cannot create instance of interface"): core does not exportorg.codehaus.plexus.configurationto plugin realms,@Mojo(configurator = "basic")does not help.Sessionhas no build start time;deleteOutdatedResourcesuses the JVM start time, so under a long-lived JVM (mvnd) stale files from an earlier build in the same daemon are not deleted.MojoExceptiononly), soMojoFailureExceptionpaths (unknown artifact, missing candidate) now report as errors.META-INF/plexus/components.xml(earArtifactHandlerandLifecycleMapping) is kept untouched and not exercised: Maven 4 core has built-ineartype andearlifecycle mapping (EarLifecycleMappingProvider), which the ITs use; a plugin-provided packaging needs the Plexus components in rc-7.PathScope.TEST_RUNTIMEhas noSYSTEMscope in rc-7, so they are not part of the module set; not covered by any IT.Tests: all 48 unit tests kept.
AbstractEarTestBasebuildsResolvedArtifactover a newstub/DependencyStub(implementsapi.Dependency); removedstub/ArtifactHandlerTestStub(v3ArtifactHandler, unused now).ArtifactTypeMappingServiceTestbuildsXmlNodeinstead ofXmlPlexusConfiguration; itstestConfigWithSameCustomTypenever populated the second mapping (it set the attributes on the first element twice), so it only exercised the missing-attribute path: kept as is andtestConfigWithSameCustomTypeRegisteredTwiceadded for the real duplicate (49 tests).AbstractEarPluginITuses plexus-utilsFileUtils. No IT source changed.Improvements: drops
maven-plugin-api,maven-core,maven-artifact,maven-plugin-annotations,javax.inject,maven-shared-utils; addsmaven-api-core/di/annotations/model/xml(provided),plexus-build-apiandorg.eclipse.sisu.plexus(needed at runtime byThreadBuildContext,AbstractLogEnabled;dependency:analyzeignore entry added).Recommendation: not mergeable as is. Port for Maven 4 and keep a 3.x line, but only after the core gaps are filed:
includesDependenciesnot honoured by the API resolver,XmlNodeparameter conversion dropping attributes, no snapshot timestamp version and no session start time in the API. The ear plugin itself ports with workarounds that restore behaviour for all 103EarMojoITcases and 17 of 18 invoker ITs;skinny-wars-timestampis the one documented behaviour that cannot be kept.maven-ejb-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT (was 3.3.1-SNAPSHOT), Java 17.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifyβ 36 tests before (19 EjbMojoTest, 10 EjbHelperTest, 7 IncludesExcludesTest) and 36 after, 0 failures/errors/skipped.mvn verify -Prun-itsβ 9/9 invoker ITs pass before (4m58s) and after;spotless:checkclean. Released artifacts only, no local snapshots: maven-archiver 4.0.0-beta-5, maven-filtering 4.0.0-beta-1, maven-plugin-plugin 4.0.0-beta-1, maven-testing 4.0.0-rc-7.User-visible changes
javax.inject,maven-plugin-api,maven-core,maven-artifact,maven-model,maven-settings, sisu annotations). A 3.x line has to stay for Maven 3 builds.ejb, phasepackageand every parameter (classifier,clientClassifier,ejbJar,ejbVersion,generateClient,clientIncludes/Excludes,excludes,archive, filtering options,outputTimestamp) are unchanged;threadSafeis no longer declared (v4@Mojohas no such attribute).EjbMojo.getProject()now returnsorg.apache.maven.api.Project(wasMavenProject);validateEjbVersionthrows the uncheckedMojoException(was checkedMojoExecutionException).EjbHelperis unchanged.ProjectManager.attachArtifact(project, project.getMainArtifact(), path); classified jar and client jar viasession.createProducedArtifact(..., type "ejb" / "ejb-client"). The old unreachableFIXMEbranch for a null client classifier did the same call as the valid branch and is merged into it.-> [Help 1], so the ITmejb-93now matches the message without it (it still asserts the same behaviour: a second execution without classifier fails).Providersclass (@Provides) suppliesProjectManagerandBuildContext(required byDefaultMavenFileFilter4.0.0-beta-1).Gaps
org.eclipse.sisu:org.eclipse.sisu.plexusmust be a compile dependency:ThreadBuildContext(plexus-build-api 0.0.7) extendsorg.codehaus.plexus.logging.AbstractLogEnabled, which a v4 plugin realm does not provide. Without it all 7 ITs failed withNoClassDefFoundError: org/codehaus/plexus/logging/AbstractLogEnabled. maven-resources-plugin master carries the same dependency.@Mojo(requiresDependencyResolution = RUNTIME)has no usable v4 equivalent with maven-plugin-plugin 4.0.0-beta-1 (dependencyResolutionPathScopesfails descriptor generation: "Method: 'dependencyResolutionPathScopes' not found in class MojoAnnotationContent"). Dropped;MavenArchiver.getManifestresolvesMAIN_RUNTIMEitself throughDependencyResolver, and themanifest-contentIT passes.AbstractMojoTestCase,MavenProjectstubs) has no v4 counterpart.Tests:
EjbMojoTestrewritten on JUnit 5 withmaven-testing(ProjectStub,SessionMock),@TempDirand a mockedProjectManager; all 18 original scenarios kept with the same assertions, one lookup test moved to@MojoTest/@InjectMojo(resource renamedplugin-config.xmltopom.xml), and two attach assertions added (verifyonProjectManager/Sessionfor the default and classified+client cases). Removed and replaced:stub/MavenProjectBasicStub,MavenProjectBuildStub,MavenProjectResourcesStub,ModelStub(v3MavenProjectsubclasses; replaced by the nestedTestProject).vintage-engineandmaven-plugin-testing-harness3.5.1 dropped.EjbMojofields are set by reflection in these tests, as before.Improvements: drops
javax.inject,maven-plugin-api,maven-core,maven-artifact,maven-model,maven-settings,maven-shared-utils,plexus-utils,org.eclipse.sisu.inject, JUnit vintage, the v3 testing harness.Recommendation: port for Maven 4; keep a 3.x line for Maven 3 users. maven-ear-plugin's pom only lists maven-ejb-plugin as an
extraArtifactfor its ITs (mavenEjbPluginVersion), so it is not a compile-time consumer; its ITs that resolve the ejb plugin would need a 4.x version together with Maven 4.maven-gpg-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17. All three goals (sign,sign-and-deploy-file,sign-deployed) ported and exercised by the ITs; one behaviour cannot be ported with the API (encrypted settings passphrases, see Gaps). No test or IT removed.Rebased 2026-10-06 onto master with apache/maven-gpg-plugin#346. The port removes the
settingsparameter that #346 deprecates. Unit tests: 10 run, 0 failed, 1 skipped.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn -B -ntp verify: 10 tests, 0 failures, 1 skipped (BcSignerTest6,GpgVersionTest3,GpgVersionConsumerTest1), before and after.-Prun-itswith the Bouncy Castle signer (bc-integration-testsplus failsafeBc*IT): invoker 13 of 13 passed andBcSignArtifactIT4 of 4, before and after. Thegpg-integration-testsexecution andGpgSignArtifactITcould not be measured: the system gpg 2.5 fails with "can't connect to the gpg-agent: File name too long" (macOS socket path limit; the worktree path is too long), which gave 1 of 13 before, so for the comparison that execution was switched off in a scratch copy of the pom in both runs. Thegpgsigner path is therefore not exercised after the port beyond compilation. Spotless clean.v4 routes
MavenProjectHelper.attachArtifact(project, type, classifier, file)becomesProjectManager.attachArtifact(Project, ProducedArtifact, Path)withsession.createProducedArtifact(g, a, v, classifier, extension + ".asc", null)(the 6-argument factory, because the shortattachArtifactoverloads cannot carry a classifier).FilesCollectorreadsProjectManager.getPath/getAttachedArtifactsandArtifactManager.getPath.sign-and-deploy-fileoutside a project: yes. Same shape asmaven-deploy-plugin4.0.0-beta-3DeployFileMojo(projectRequired = false): artifacts fromsession.createProducedArtifact, paths viaArtifactManager.setPath, deploy viaArtifactDeployerwithArtifactDeployerRequest(itsretryFailedDeploymentCountreplaces the hand-written retry loop), repository fromsession.createRemoteRepository(id, url), POM read/generated withModelXmlFactory. Signing itself has no API and stays inGpgSigner/BcSigner.sign-deployed:session.withLocalRepository(session.createLocalRepository(tmp))for the private repo,resolveArtifacts(coordinates, repos),ArtifactDeployerfor the.ascfiles.Public API changes
org.apache.maven.api.plugin.Mojo;MojoExecutionException/MojoFailureExceptionbecome the uncheckedMojoExceptionin all public signatures (AbstractGpgSigner,GpgSigner,BcSigner,GpgVersionParser,FilesCollector).BcSigner(Session, ...)and itsLoadermethods takeorg.apache.maven.api.Sessioninstead of the aether session;FilesCollector(Session, Project, String[], Log)(wasMavenProject, String[], Log);AbstractGpgMojo.getPassphrase(Project).ArtifactCollectorSPI.collectArtifacts(Session, RemoteRepository)now usesorg.apache.maven.api.Artifact/RemoteRepository/Session: an SPI break for any implementor.settingsparameter (${settings}) and the injectedSettingsDecrypterare gone;session.getSettings()is used.env.MAVEN_GPG_*) are read from the session user then system properties (BcSigner.getEnv), replacingRepositorySystemSession.getConfigProperties().Gaps
settings.xml: rc-7 has no decrypt service in anymaven-api-*module (SettingsDecrypterexists only in compatmaven-settings-builder, andmaven-implnever calls it).gpg.passphraseServerIdvalues that look encrypted ({...}) now fail with an explicitMojoExceptioninstead of being signed with as cipher text; plain passphrases still work (ITsign-with-passphase-from-maven-settingspasses). Needs a settings-decrypt service inmaven-api-coreto be closed.Project.getModel().getProperties()is immutable).ModelValidatorstrict validation of the coordinates insign-and-deploy-filehas no API equivalent; replaced by a local check (groupId/artifactId[A-Za-z0-9_.-]+, version without path or whitespace characters, packaging non-blank), which is looser than the model validator.ArtifactHandlerManagerreplaced byTypeRegistry.lookup(packaging); unknown types fall back to extension = type, as before.MojoFactory(NoSuchMethodError: SignDeployedMojo.<init>()):SignDeployedMojouses field injection,@Inject @Nullable Map<String, ArtifactCollectorSPI>(an empty map otherwise fails to inject).BcSignerTestbuilt an aether session withmaven-resolver-impl; it now uses ajava.lang.reflect.ProxyoverSessionthat answers only the two property maps (no new test dependency, which would need a pgpverify keys-map entry).<proc>none</proc>removed from the compiler configuration so the api.di index is generated.plexus-utils(FileUtils,SelectorUtils,Os,cli.*,CachingOutputStream) is not a Maven API and stays.User-visible changes
<prerequisites>followsmavenVersion.MojoFailureException: Do not store passphrase...is nowMojoException: ...(ITsign-release-best-practices-failupdated).retryFailedDeploymentCountlog lines ("Retrying deployment attempt") no longer come from the plugin.maven-resolver-impltest dependency and theresolverVersionproperty removed.Improvements: drops
maven-core,maven-plugin-api,maven-artifact,maven-model,maven-model-builder,maven-settings,maven-settings-builder,maven-resolver-api/util,maven-plugin-annotations,javax.inject.Recommendation: port is viable; do not merge until the settings-decrypt gap is decided (file against apache/maven), and run the
gpgsigner ITs on a machine with a short checkout path.maven-help-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT (was 3.5.3-SNAPSHOT), Java 17. Two goals are degraded, see Gaps.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifybefore β 30 tests, 0 failed, 0 skipped; after β 61 tests, 0 failed, 0 skipped.mvn verify -Prun-itsbefore β 34 passed, 0 failed, 2 skipped (12m27s); after β 36 passed, 0 failed, 0 skipped (18m03s, run on a copy of the tree);describe-cmd-with-goal-reportfailed on its first attempt (the report check loggedCouldn't identify if this goal is a report goal: org/apache/maven/plugin/AbstractMojo, cause not isolated) and passed on the invoker retry.spotless:checkclean. No local snapshots consumed, released artifacts only.User-visible changes
org.apache.maven.api.plugin.Mojos;session,project,Logand the services are@Injected. Goal names, phases and parameter names/properties are unchanged;outputis now aPath(same XML syntax). The plugin no longer loads under Maven 3: a 3.x line has to stay.evaluate: the expression evaluator of Maven 3 is gone. The new one (ExpressionEvaluator) handlesproject,session,settings,mojo,plugin,localRepository,reactorProjects,basedir,rootDirectory,env.X, then project properties, session properties and system properties, through the public getters of the API objects (a.b.c,list[0],map(key)).${project.x}falls back to the model whenProjecthas no getter, soproject.nameandproject.propertieswork. Objects that are not a model, settings or scalar are written byXmlRenderer(bean, list, map), not by XStream, so the element order of such output is alphabetical instead of field order. Interactive mode uses thePrompterservice instead ofInputHandler.effective-pom: properties are written sorted (the ITeffective-pom_propertiesexpected the reversed hash order of Maven 4 with the old plugin; it now expects the sorted order on every Maven version). Verbose location comments go throughXmlWriterRequest.inputLocationFormatter.active-profiles: the source of a POM profile is theg:a:vof the POM in the parent chain that declares it (fromgetDeclaredActiveProfiles), settings profiles are listed once asexternal. The ITsactive-profilesandactive-profiles_multimodulepass.list-lifecycle-phases,describe -Dcmd=<phase>: phases are the Maven 4 ones (before:compile,after:resources, ...).describe -Dcmd=process-resourcesstill works throughLifecycle.aliases().list-packaging,list-dependency-types: only the ids Maven itself defines are listed (see Gaps).describe: plugingroupId:artifactId[:version]works through the plugin jar and itsMETA-INF/maven/plugin.xml;-Dplugin=<prefix>and-Dcmd=<prefix>:<goal>work for the plugins of the project and formaven-<prefix>-plugin/<prefix>-maven-pluginin the plugin groups of settings,org.apache.maven.pluginsandorg.codehaus.mojo.evaluate-model-collectionsandevaluate-settings-serverswere skipped on Maven 4 (invoker.maven.version = 4-, XStream could not serialise immutable maps); they now run and pass, the skip line is removed.Gaps
describeonly: plugin prefix resolution from the repositories' group metadata (MojoDescriptorCreator.findPluginForPrefix,PluginPrefixResolver). The prefix heuristic above cannot find a plugin with a non-conventional artifactId that the project does not declare. No plugin version resolver either: a missing version is the one of the project'sbuild/pluginsorpluginManagement, else the highest non-snapshot of the version range. Relocations of the plugin POM are not followed (ArtifactResolverdoes not read the descriptor).list-packagingandlist-dependency-types:PackagingRegistryandTypeRegistryonly look up by id (ExtensibleEnumRegistryhas no listing), and the legacy handlers come from Sisu components. The goals probe the constants oforg.apache.maven.api.Typeplusejb,ejb-client,war,ear,rar,par,sources,test-sources, and the packagingspom, jar, maven-plugin, ejb, ejb3, war, ear, rar. A packaging or type that a third-party extension registers is not listed.describewith a plugin whose POM Maven 4 rejects (the IT uses maven-help-plugin:2.0):ProjectBuilderRequesthas no validation level, so the name is read from the POM file and the report-goal check falls back to the runtime dependencies.MojoDescriptor/Parameterdrop the<configuration>element of a Maven 3plugin.xml(default value, expression).describereads it with its own DOM pass so that "Default" and "User property" still show for Maven 3 plugins.evaluatecannot evaluate what Maven 3 evaluated throughPluginParameterExpressionEvaluatorand the session internals: anything that is not reachable through a public getter or method of the API objects (for example the plugin context). Unmeasured beyond the expressions in the ITs andExpressionEvaluatorTest.active-profiles: Maven 4 gives no per-model activation record, onlygetDeclaredActiveProfiles()per project, so the source is the POM in the parent chain that declares the active profile.Tests:
AbstractHelpMojoTestnow testsparseCoordinates(same four cases); inDescribeMojoTestthe three lookup tests that mockedMojoDescriptorCreator/PluginVersionResolver/MavenPluginManagerare replaced by lookups on a generated plugin jar (prefix with and without version, GAV); thedescribeCommandtests run on mockedLifecycleRegistry/Packaging. No test was deleted; new:EffectivePomMojoTest,EffectiveSettingsMojoTest,ExpressionEvaluatorTest,ListMojosTest.Improvements: drops
maven-artifact,maven-core,maven-model,maven-model-builder,maven-plugin-api,maven-settings,maven-resolver-api,javax.inject,org.eclipse.sisu.plexus,maven-plugin-annotations,maven-shared-utils,plexus-interactivity-apiandxstream.plexus-utils(needed at runtime byHtmlToPlainTextConverter, whose own dependencies are excluded),plexus-xml,jdom2,maven-reporting-api4.0.0 (only theMavenReporttype check) andmaven-plugin-tools-generatorsstay. Addsmaven-api-core/di/annotationsandmaven-xml(provided).Recommendation: port for Maven 4 and keep a 3.x line for Maven 3. Upstream follow-ups worth filing: a listing method on
ExtensibleEnumRegistry; a plugin-prefix and plugin-version resolution service in the API;MojoDescriptorkeeping the v3<configuration>defaults; a validation-level option onProjectBuilderRequest; a public expression evaluator for plugins.maven-invoker-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17.Rebased 2026-10-06 onto master with apache/maven-invoker-plugin#760, and its script bytecode-level resolution ported to
Session. Unit tests: 73 run, 0 failed (67 before); ITs not run, including #760's new IT.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 67 unit tests before and after, 0 failures, 0 skipped; spotless clean.-Prun-its(92 IT projects): before, the 30 min time-box hit after 45 ITs (all 45 passed, none failed); after, the same 45 ITs ran in 1770 s and all pass (44 at first,staging-pomafter the fix below), plus 26 more selected by the code they touch (-Dinvoker.test=list of settings-, script-, local-repo-, staging-, install-, invoker-report, ...): 24 pass, 2 fail (MINVOKER-377-install-ignore-split-repo,invoker-report, see Gaps). Not run, before or after: 22 ITs (MINVOKER-196, -288-failed-setup-verify, -289, -294, -330, exec-timeout-mojo-level, fail-build-with-verify, fail-ignore*, fail-noprojects_verify, invocation-cmdline-exclude, invocation-debug, invocation-group-properties, invocation-reactor-indirect, invocation-spaces, multiple-pre-post-build, project-cloning-reactor, rerun-build, rerun-build-invoker-test-in-config, script-streamLogs-false). Not measured: running the ported plugin under Maven 3; heavy machine load (load average >100) makes the IT timings unreliable.Uses
maven-api-core/-di/-annotations/-model/-settings4.0.0-rc-7 (provided), plugin-tools 4.0.0-beta-3, and the local snapshotsmaven-reporting-apiandmaven-reporting-impl5.0.0-SNAPSHOT (agent/mvn4-api branch of reporting-impl, already in the local repository, not rebuilt here). maven-invoker 3.3.0 and maven-script-interpreter 1.9 use no Maven API and are unchanged.v4 route for install into an alternate local repository (
invoker:install):Session.withLocalRepository(session.createLocalRepository(path))gives a session bound to the staging repo;DependencyResolver.resolve(DependencyResolverRequest{project|root dependency, PathScope})returnsgetDependencies()(Dependency to Path) for the transitive closure; POMs and their parent chains come fromsession.resolveArtifact(createArtifactCoordinates(g, a, v, "pom"), repos);ProjectManager.getRemoteProjectRepositories/getRemotePluginRepositoriessupply the repositories;altSession.installArtifacts(...)writes them. Scoperuntime/compile/testmaps toPathScope.MAIN_RUNTIME/MAIN_COMPILE/TEST_RUNTIME. Two traps, both hit by ITs:Session.setArtifactPath(ProducedArtifact, Path)rewrites the file of every reactor project artifact with the same id and throwsUnsupportedOperationException: transformed artifact file cannot be setfor the project's own (transformed) POM. Reactor artifacts must be installed as they are (Project.getArtifacts()+ProjectManager.getAttachedArtifacts(), the file travels inside the artifact);setArtifactPathonly for downloaded ones.Project.getParent()returns only reactor parents, unlikeMavenProject.getParent(); the parent chain has to be walked throughproject.getModel().getParent()and resolved (ITstaging-pomcaught it).Script-visible bindings (
ScriptRunnerglobals, maven-script-interpreter): none of them carries a Maven type, so no binding changes type.basedir(script dir,File),context,scriptFile,logger,localRepositoryPath(File),mavenVersion(String) andscriptVariablesare as before. Value changes:localRepositoryPathdefault is nowsession.getLocalRepository().getPath()(follows-Dmaven.repo.local; was${settings.localRepository});mavenVersionwith nomavenHomeissession.getMavenVersion(). What does change is the script class path: scripts used to see the Maven 3 plugin realm, soorg.apache.maven.plugin.MojoExecutionException(ITsettings-merge/postbuild.groovy, now throwsIllegalStateException),MavenProjectand friends resolved; in a v4 plugin realm they do not (unable to resolve class org.apache.maven.plugin.MojoExecutionException). WithaddTestClassPaththe test class path is resolved bysession.resolveDependencies(project, PathScope.TEST_RUNTIME)plus the project's test and main output directories, minus the plugin's own artifact and dependencies.Public API changes
Mojo,@Inject,@Mojo(defaultPhase = "...")); all mojos throw the uncheckedMojoException.MojoFailureException(BUILD FAILURE) andMojoExecutionException(error) are no longer distinguishable.install,run,integration-test,verify,reportand their parameters keep names and properties.requiresDependencyResolution = TESTandthreadSafe = trueare gone (no v4 attribute);installandrunresolve what they need themselves.localRepositoryPath(install and run) has no expression default; it falls back to the session's local repository.projectsDirectorydefault is${project.basedir}/src/it/because${basedir}is not evaluated in v4 (it stays literal andrunthen reports "No projects were selected").invoker.install.scopealso accepts the v4 path scope ids.AbstractInvokerMojo/InstallMojoconstructors are gone (Invoker,SettingsBuilder,ToolchainManager,MavenProject,MavenSessionare no longer injected;DefaultInvokeris instantiated, v4 services come fromsession.getService).InvokerReportno longer takes anI18N; it reads theinvoker-reportbundle directly.CompositeMap) now readsproject.*/pom.*from the effectiveModel(plusbasedir,file): expressions that hitMavenProject-only getters (project.artifact,project.fileasFile,project.compileSourceRoots) no longer resolve.mergeUserSettings: the merge is hand-written (mergeSettingsinAbstractInvokerMojo), dominant entries win by id, because the v4 API has noSettingsUtils.merge; the MINVOKER-133sourceLevelSetreset has no counterpart (immutable settings model).<subprojects>, which v3 could not read (not exercised by an IT).Gaps
invoker:installcannot pin the resolver config of the staging repository. The v3 code cloned the repository session withaether.enhancedLocalRepository.split=false(MINVOKER-377);Session.withLocalRepositoryinherits the outer build's config and offers no way to override it. ITMINVOKER-377-install-ignore-split-repofails (artifacts land underinstalled/, not the flat path). Not worked around: copying files and writingmaven-metadata-local.xmlby hand would be inventing an installer. The forked builds still get-Daether.enhancedLocalRepository.split=false, sorunis unaffected.AbstractMavenReport(reporting-impl 5.0.0-SNAPSHOT) but cannot run. Standalone,mvn org.apache.maven.plugins:maven-invoker-plugin:4.0.0-beta-1-SNAPSHOT:reportfails withA required class was missing ... report: org/apache/maven/execution/MavenSession(NoClassDefFoundErroratLegacyMavenBridge.<init>fromAbstractMavenReport.getSiteTool, because the doxia-tools/site-tool side still needs maven-core classes that a v4 plugin realm does not have). Throughmvn site, maven-site-plugin 3.22.0 fails withFailed to get report for org.apache.maven.plugins:maven-invoker-plugin: Unable to lookup Mojo: Cannot cast org.apache.maven.plugins.invoker.InvokerReportFactory to org.apache.maven.plugin.Mojo(ITinvoker-report). Needs doxia-sitetools, site plugin and reporting-exec on v4 first.Mojo/PluginAPI for "the plugin realm's artifacts" (plugin.artifacts): approximated withMojoExecution.getPlugin().getArtifact()/getDependencies()andSession.getArtifactPath.addTestClassPath.MavenProject/MavenSession/Settingsreplaced by mocks ofProject/Session/Settings, constructors without arguments,InterpolatorUtilstakes aMap. ITsettings-mergescript changed as above.User-visible changes
invoker.propertieskeep working unless they touch Maven 3 API classes (see bindings);${project.*}filtering keeps working for model properties.invoker:report/site integration does not work on the 4.x line yet;invoker:verifyand theinvoker-reportsXML are unchanged.invoker:install(MINVOKER-377 regression).Improvements: drops
maven-core,maven-model,maven-plugin-api,maven-artifact,maven-settings,maven-settings-builder,maven-resolver-api/-util,maven-plugin-annotations,javax.inject,plexus-i18nandsisu-maven-plugin; the install logic no longer talks toRepositorySystem/RepositoryUtils/ProjectArtifact.<prerequisites><maven>follows${mavenVersion}.Recommendation: port the run, install and verify goals as a 4.x line once MINVOKER-377 has an answer (a Session-level way to set resolver config, or a documented flat-layout install); keep the report goal on 3.x until the reporting chain is on v4 (then only
InvokerReportand the renderer need touching). Scope: the 22 unrun ITs should be run before any merge.maven-jarsigner-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 51 tests before, 52 after (one added for the proxy path), 0 failures, 0 skipped;mvn verify -Prun-itsβ 9 of 9 ITs pass before and after;spotless:checkclean. Smoke runs outside the ITs on rc-7 (scratch project, not committed): toolchain selected through maven-toolchains-plugin 3.2.0, active proxy passed to jarsigner (offline run),storepass/keypassencrypted in the legacy{...}form with asettings-security.xmlmaster password. Not exercised: the new-formatsettings-security4.xml, thegpg-agent,pinentry-promptandsystem-propertymaster sources, Windows.Public API changes
AbstractJarsignerMojoimplementsorg.apache.maven.api.plugin.Mojoinstead of extendingAbstractMojo;execute()and the protected hooks throwMojoExceptioninstead ofMojoExecutionException. The protected constructor takingJarSigner,ToolchainManagerandSecDispatcheris gone; the mojos get aDefaultJarSignerand their services injected.@ParametertypesFileβPathforarchive,archiveDirectory,workingDirectoryandcertchain.project,settingsandsessionare no longer parameters.getLog()returnsorg.apache.maven.api.plugin.Log.ToolchainAdapter(see Gaps), package-privateSecDispatchers;META-INF/plexus/components.xmldeleted.maven-jarsigner3.1.0 is unchanged. It uses no Maven API, so it needed no port.Gaps
storepassandkeypassitself, and Maven's own decryptor is wired insidemaven-impl(DefaultSettingsBuilder), not reachable from a plugin.SecDispatchersrebuilds it asApiRunner$SecDispatcherBindingsdoes, frominternalclasses of plexus-sec-dispatcher 4.2.0 (AESGCMNoPadding,MasterDispatcher,LegacyDispatcher,DefaultSecDispatcher), reading${user.home}/.m2/settings-security4.xml. That is a copy of Maven's wiring and will drift from it.Settings, only the active proxy host, port andnonProxyHosts. For settings passwords the v4 route isSession.getSettings():maven-implwraps settings in aDecryptingSettingsTransformerfor server and proxy passwords (seen in bytecode, not executed here).Settingshas nogetActiveProxy(); the plugin takes the firstProxywithisActive().ProjectManagerhas no DI binding in rc-7 (No binding to construct an instance for key ProjectManager;ArtifactManager,ToolchainManager,Session,Project,Logdo bind). The plugin usessession.getService(ProjectManager.class).findTool(String)reflectively on the object's class, which is the non-publicDefaultJavaToolchainFactory$DefaultJavaToolchain, so it logsunexpected IllegalAccessExceptionat WARN and runs the JDK that runs Maven.ToolchainAdapteris a public wrapper for that call. A plugin on anymaven-shared-utilsJavaTool(jmod, jlink, jdeps, jdeprscan) has the same trap.@Mojohas nothreadSafeattribute;signkeeps its ownthreadCountexecutor.plugin.xmllists every parameter with<defaultValue>and has no<configuration>block; the test helperPluginXmlParserreads the new layout. An unsetString[]parameter (tsa,tsacert,tsapolicyid) arrives as an empty array, as thebasicIT shows.User-visible changes
<prerequisites>followsmavenVersion. The plugin no longer loads under Maven 3.org.sonatype.plexus:1.4toorg.codehaus.plexus:4.2.0, both bundled.Improvements: drops
maven-plugin-api,maven-core,maven-artifact,maven-settings,maven-plugin-annotations,javax.injectand the Plexus component descriptor.Recommendation: port once the gaps are in the open: a decrypt service in the API,
ProjectManagerbindable, and a public toolchain type orfindToolhook in maven-shared-utils. Release it as a separate 4.x line; the 3.x line keeps serving Maven 3.maven-site-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17. Every goal is a Maven 4 API mojo and runs in a real Maven 4.0.0-rc-7 build; the plugin cannot generate reports, because the Maven 4 API has no way to run another plugin's mojo (see "What the Maven 4 API must add for reports").Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn verifybefore β 12 tests, 0 failures; after β 12 tests, 0 failures.-Prun-its(whole suite, no time-box hit): before β 62 of 62 ITs pass (5:29 min); after β 40 of 62 pass (4:27 min). The 22 that fail all verify report output: theirtarget/sitetrees differ from the before-run only by missing report pages (project-info.html,project-reports.html,surefire.html,dependencies.html,checkstyle.html, javadoc pages, ...), with no extra and no missing handwritten page, and each build ends in BUILD SUCCESS with the warning below (failureexpects its first builds to fail on a failing report plugin and gets exit code 0).spotless:checkclean. Not run in CI.site:runhas no IT; smoke-tested by hand (200 for a rendered markdown page, 404 for a missing one).Snapshots consumed:
doxia-integration-tools,doxia-site-renderer,doxia-site-model3.0.0-SNAPSHOT from the local port branchagent/mvn4-api(worktree,mvn install -DskipTests);maven-reporting-api4.0.0 andmaven-archiver4.0.0-beta-5 (releases).maven-reporting-exec3.0.0-SNAPSHOT (worktree was installed only for the experiment below; the plugin does not depend on it.Per-goal status
site:effective-siteeffective-site,inheritance-interpolationsite:attach-descriptorMSITE-566,site-attach-descriptorsite:stagesite-sd*,site-skip(goal ran insite-inheritance,site-sd-lang, whose other assertions need reports)site:stage-deploysite:deploysite-deploy,MSITE-548,MSITE-604,MSITE-705-*; unit tests over a DAV wagon, with and without proxysite:siteMSITE-159,MSITE-354,doxia-formats,template-skin,resources,gh-1286-missing-skin,default-reports-excludedand others pass; no report, noproject-info.html/project-reports.htmlsite:jarsitesite-jarsite:auto-refreshsiteauto-refreshsite:runsitesite:helpPublic API changes
org.apache.maven.api.plugin.Mojowithorg.apache.maven.api.plugin.annotations;Session,Project,LogandMojoExecutionare injected into fields.AbstractSiteMojo.execute()is final and callsdoExecute(); subclasses in other plugins must follow.mavenSession,repoSession,reactorProjects,remoteProjectRepositories,projectasMavenProject,siteTool,i18n,siteRenderer,mavenReportExecutor(nowgetSiteTool(),getI18n(),getSiteRenderer()); constructors with injected components.ReportDocumentRenderer,CategorySummaryDocumentRenderer(nothing can produce aMavenReportExecution),SiteDescriptorArtifactMetadata(unused Maven 3 artifact metadata).SitemapDocumentRenderertakes aStringinstead of aMojoExecution;DoxiaHandlerloses the external-report branch.SisuContainer,ParentAwareProject(package-private).User-visible changes
<prerequisites>followsmavenVersion. Theplugin.xmlis only written in the v4 format when that prerequisite starts with4., otherwise Maven 4 rejects the mojos withcannot be cast to org.apache.maven.plugin.Mojo.<reporting>plugins and the defaultmaven-project-info-reports-pluginare skipped withWARNING Reports are not generated: ... Skipping N configured report plugin(s) and the default maven-project-info-reports-plugin.generateReportsandgenerateProjectInfoare accepted and inert; noproject-info.html,project-reports.htmlor report pages;<menu ref="reports"/>is dropped;<item ref="...">to a report is removed with a warning.@Mojohas norequiresReportsorthreadSafe, andrequiresDependencyResolution = TESTis dropped (the v4 attribute isdependencyResolutionPathScopes, not used): the site goals no longer resolve test dependencies and are not declared thread-safe.$projectis the immutableorg.apache.maven.api.model.Model, notMavenProject:$project.name,.url,.organization,.properties.get(...)still work;$project.parentis the<parent>element (nourl, no furtherparent), andbasedir,artifacts,compileSourceRootsare gone.$plexusis the plugin's private Sisu container, so$plexus.lookup("org.apache.maven.Maven")no longer works (ITdoxia-formatsnow looks upSiteTool). Diff of the renderedvelocity-context.htmlbefore/after shows only this and the version numbers.siteOutputDirectory/outputDirectoryno longer default to${project.reporting.outputDirectory}(empty in Maven 4); unset means${project.build.directory}/site, or<reporting><outputDirectory>if the POM sets one.encoding,outputEncoding,outputTimestampdefault from the POM propertiesproject.build.sourceEncoding,project.reporting.outputEncoding,project.build.outputTimestampread in code;${basedir}defaults became${project.basedir};jarOutputDirectoryandfinalNameusedefaultValueexpressions instead ofproperty = "project.build.*".site:jar/site:attach-descriptorattach throughProjectManagerwithcreateProducedArtifact;site:jarbuilds withnew JarArchiver()and maven-archiver 4.0.0-beta-5.site:stagetakes the execution root fromProject.isTopProject().site:auto-refreshprompts throughorg.apache.maven.api.services.Prompter.wagon-fileis added as a plugin dependency (a build without it was not tried), other providers must be plugin dependencies as before. Server and proxy passwords are decrypted with the Maven 3SettingsDecrypterfrommaven-settings-builder4.0.0-rc-7, because the Maven 4 API has no decryption service (known gap in Measure the impact of porting Maven components and plugins to the Maven 4 APIΒ #13302).SiteMavenProjectStubreplaced by Mockito over the API interfaces (DeployTestSupport); the three deploy tests no longer use the harness. All 12 tests kept.doxia-formatslooks upSiteToolinstead oforg.apache.maven.Maven;inheritance-interpolationwalks only the child level inpom.apt.vmand drops the 6 assertions about the three ancestor rows (they need$project.parentto be a project, which the model is not). 22 report ITs are left failing, not edited.Gaps
org.apache.maven.api.*; a probe mojo in the plugin realm failed to loadMavenPluginManager,MavenSession,LifecycleExecutor,PluginVersionResolver,MavenProject,org.apache.maven.plugin.Mojo,org.apache.maven.artifact.Artifact,org.apache.maven.model.Model,org.apache.maven.di.Injector,DefaultSession,InternalSession(allClassNotFoundException), andDefaultMavenReportExecutor(reporting-exec 3.0.0-SNAPSHOT) failed to initialise withNoClassDefFoundError; Sisu reports onlyNoSuchElementException: role MavenReportExecutor.Project.getParent()is empty for a parent that is not in the reactor. Maven 3MavenProject.getParent()built it from the repository, and site descriptors (skin, banner, menus) anddistributionManagement.site.urlwere inherited along that chain. Without a workaround,inheritance-interpolationstopped at the reactor parent and lostrepo-parent's site descriptor (-Xlog:Reading parent level 2 site descriptorbefore, absent after); a project that takes its skin only from a repository parent would fail with "No skin is declared" (not run). Worked around in the plugin byParentAwareProject, which builds the parent withProjectBuilder.build(request.path(resolved pom))and reportsgetBasedir() == nullfor it. The fix belongs in the API (Project.getParent()) or in doxia-sitetools.Model.getName()is null when the POM has no<name>; Maven 3MavenProject.getName()fell back to the artifactId, and the portedDefaultSiteToolreads the model, so breadcrumbs lost the entries of nameless ancestors.ParentAwareProject.getModel()restores the fallback. The fix belongs in doxia-sitetools#701.Lookupdoes not see the plugin realm's Sisu index.SisuContainerstarts a privateDefaultPlexusContainerover the plugin class loader (SCANNING_INDEX). It works, but the plugin must declareorg.eclipse.sisu.inject,guice5.1.0 (the version in the Maven 4 distribution; Guice 6 not tried) andjavax.inject, setversion.plexus-xmlto 4.2.0 (parent 50 manages 3.0.1, which fails with the class realm), and every Sisu failure surfaces asNoSuchElementException.SiteToolandSiteRenderercannot be injected into a v4 mojo without this.maven-settings-builderandmaven-settings4.0.0-rc-7 are compile dependencies only for this. Only the proxy path is exercised (unit test with a proxy user and password); the server path is the same call and is not exercised with an encrypted password.Projecthas no public implementation, so the tests mock the interface with Mockito.What the Maven 4 API must add for reports
What the Maven 3 site plugin does, by
DefaultMavenReportExecutor(maven-reporting-exec), step by step, and what Maven 4.0.0-rc-7 offers:<reporting>plugin (missing version,RELEASE, pluginManagement)PluginVersionResolverSession.resolveVersion*resolves artifact versions, not plugin versions from metadata/prefixes)MavenPluginManagerHelper,MavenPluginManager.getPluginDescriptor/setupPluginRealm,PluginDescriptor,ClassRealm(withIMPORTS/EXCLUDES)api.Plugin(descriptor, class loader) exists but only for the plugin currently executing, reached through an injectedMojoExecution; nothing returns aPluginfor another GAV;PluginXmlFactoryparses aplugin.xml, nothing moreMojoExecutionforgoalwith the merged configuration (pluginManagement + reporting + reportSet)new MojoExecution(plugin, goal, executionId)api.MojoExecutionis an interface with no factory (XmlNode.mergeexists for the configuration)Session/Project/Log, bind parameters with expressions, without executing itMavenPluginManager.getConfiguredMojo(Mojo.class, session, execution)PluginParameterExpressionEvaluatorV4are inmaven-core/maven-impl, not exported@Execute) the report needs firstLifecycleExecutor.calculateForkedExecutions/executeForkedExecutionsMavenProject.isExecutionRoot()Project.isTopProject()covers it (reporting-exec's note that onlyisRootProject()exists is out of date)MavenReportand call itMavenReportMavenReport(reporting-impl 5.0.0-SNAPSHOT), once the mojo can be obtainedConfirmed against rc-7 and against maven-api-core 4.1.0-SNAPSHOT (20260928):
Sessionhas no plugin-related method beyondgetPluginContext(Project);Plugin/MojoExecutionare only reachable fromEvent.getMojoExecution()and injection;Lookup.lookupdoes not see other plugin realms;LifecycleRegistryandProjectBuilderdo not help. A plugin cannot work around it: it can resolve the report plugin's artifacts and parse itsplugin.xml, but would have to re-implement realm imports, DI, parameter expressions and forked executions (all insidemaven-core/maven-impl), and bundlingmaven-corefails on class identity.Smallest addition that unblocks reports (sketch, in
org.apache.maven.api.services):PluginRealmOptionshas to carry the packages the caller shares with the plugin's realm (hereorg.apache.maven.reporting,org.apache.maven.doxia.sink), which Maven 3 passed asIMPORTS/EXCLUDES.Projectalso needsgetParent()to return repository parents (Gap 2) and the site tools need Sisu-free components (Gap 4).No-new-API alternative, not implemented: stop running reports in the site plugin's JVM-side lifecycle and let each report plugin run as an ordinary goal that writes Doxia source into
${project.build.directory}/generated-site(whichsite:sitealready renders); the menu and category summary would need a small per-report descriptor instead ofMavenReport.getName/getCategoryName/getOutputName. That moves the contract fromMavenReportto files, so every report plugin changes.Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-artifact,maven-resolver-provider,maven-reporting-exec,maven-plugin-annotations, themaven-archiver3.x line and the Maven 3 resolver pins. Addsmaven-api-*(provided), the Sisu/Guice/javax.injectruntime,maven-settingsandmaven-settings-builder(decryption) andwagon-file, so the dependency count does not go down.Recommendation: do not merge. Keep a 3.x line for reports. The
site:sitewithout reports,stage,stage-deploy,deploy,attach-descriptor,effective-site,jar,runandauto-refreshwork on the Maven 4 API today and are a starting point for a v4 site plugin; it needs (1) a plugin-manager service like the sketch above, (2)Project.getParent()returning repository parents, (3) Sisu-free doxia-sitetools, (4) a settings decryption service, before reports and real-world site descriptors behave as on Maven 3. Until then a Maven 4 build that callsmvn sitewith this plugin silently produces a site without reports.slachiewicz commentedon Sep 30, 2026
Wave 4 findings, part 3 of 4: maven-javadoc-plugin to maven-rar-plugin
Each plugin is a local branch
agent/mvn4-apiwith a "Build with Maven 4 only" commit and a "Port to the Maven 4 API" commit; the PRs are not opened yet.maven-javadoc-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17. Every goal is ported and runs as a direct goal on Maven 4.0.0-rc-7; nothing runs as a site report (blocked).Rebased 2026-10-06 onto master with apache/maven-javadoc-plugin#1390, so sibling modules are now invoked through maven-executor. Unit tests: 75 run, 0 failed, 8 skipped; ITs not rerun.
Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn clean verifyβ 72 tests before (8 skipped, 0 failures), 75 after (8 skipped, 0 failures; 3 added); spotless, RAT and checkstyle pass.-Prun-its(93 ITs, run as two-Dinvoker.test=halves because the suite exceeds the 30 min time-box) β before 79 passed, 3 failed, 11 skipped; after 75 passed, 7 failed, 11 skipped. Pre-existing failures, before and after: MJAVADOC-181, MJAVADOC-444 (bothsite), MJAVADOC-568_jar-mixed. The 4 new failures are allsiteITs (MJAVADOC-134_multiaggregate, -259, -369, site-failOnError), see Gaps. The other 89 outcomes are identical. Skipped: JRE-version (doclava, JDK 23 fonts) and toolchain-version ITs. No test deleted; 13MavenProjectStubclasses removed because the v4 harness reads the POM (see tests below).testJavadocResourcesWithExcludesfails on a second run withoutclean, before and after.Per-goal status
jarpackagebuild with attach and installtest-jarpackage+installattached and installed-test-javadoc.jaraggregate-jar,test-aggregate-jarresource-bundle,test-resource-bundlejavadoc,test-javadoc,aggregate,test-aggregate,*-no-forkmvn javadoc:javadoc)mvn sitehas no v4 routefix,test-fixhelpincluded)jdkToolchainwith JDK 21 running Maven and a JDK 8 toolchain: logToolchain in maven-javadoc-plugin: JDK[...zulu-8...], JDK 8 output (allclasses-frame.html); build-context path via maven-toolchains-plugin 3.2.0 +jarin onepackagebuild also selects JDK 8JavaPathTypeis not useddetectLinks,detectOfflineLinks,detectJavaApiLinkdetectLinksresolved the dependency POM throughArtifactResolver+ProjectBuilderand validated the URL online β-link https://commons.apache.org/proper/commons-lang/apidocsadditionalDependencies,docletArtifact(s),tagletArtifact(s),resourcesArtifacts-docletpathand-tagletpathheld the artifact plus its compile-scope transitive dependencies,-classpathheld the additional dependency; unit tests cover taglet/stylesheet/helpfile artifactsincludeDependencySources)Differential check of the report goals: the released 3.11.2 and this port run on the same probe projects under Maven 4.0.0-rc-7. The
-Xparameter dump of all 7 non-site goals is identical exceptdetectOfflineLinks(3.11.2 had an older default) and the injected objects. Foraggregateon a two-module reactor with provided and runtime scopes thejavadocoptions file is byte identical after path normalisation;javadocandtest-javadocdiffer only in class path order. This found three defects that the ITs had not (fixed):${project.name}left unevaluated,systemscope dependencies dropped, runtime dependencies missing from the test class path.Concrete build error (reporting chain): as in the changelog finding. Real build, maven-site-plugin 3.22.0 on rc-7, MJAVADOC-134_multiaggregate:
Failed to get report for org.apache.maven.plugins:maven-javadoc-plugin: Unable to lookup Mojo: Cannot cast org.apache.maven.plugins.javadoc.AggregatorJavadocReportFactory to org.apache.maven.plugin.Mojo.reporting-api4.0.0 has no Maven 3 dependency, soMavenMultiPageReportis still implemented and compiles; only the site plugin is missing.User-visible changes
jarOutputDirectoryandfinalNameno longer take-Dproject.build.directory/-Dproject.build.finalName(a v4propertyis a user property, not an expression; nowdefaultValue);${basedir}defaults are${project.basedir}.additionalDependencieselement typeAdditionalDependencyis now a plain bean (groupId, artifactId, version, type, classifier, scope) instead of a subclass of the modelDependency;<exclusions>,<optional>,<systemPath>inside it are no longer accepted.*NoFork*mojos are now the base classes and the forking ones subclass them (an inherited@Executecannot be cancelled).TestJavadocReportno longer extendsJavadocReport. The plugin descriptor shows the same goals andexecutePhasevalues.requiresDependencyResolution: the mojos resolve inexecute()(javadoc/jar: compile + provided + direct system; test goals: + test + runtime), so a goal no longer fails before the mojo for an unresolvable dependency but inside it.localeis validated against the JVM locales only; the Doxia site tool also required a Maven Site translation.detectOfflineLinksuse the default settings and toolchains files;-s,-gs,-t,-gtare not passed on (no v4 API).mvn sitewith the plugin under<reporting>fails until maven-site-plugin has a v4 release.AbstractJavadocMojoimplementsorg.apache.maven.api.plugin.Mojo; constructors with injected components are gone (field@InjectofSession,Project,MojoExecution,Log);MavenProject/MavenSession/Toolchainsignatures becomeProject/Session/org.apache.maven.api.Toolchain;ResourceResolveris a plain class (was a Sisu component) andSourceResolverConfigtakes aSession;resolveDependencytakesAdditionalDependencyand returns aPath.Gaps
@Execute(phase = "none")fails plugin-tools 4.0.0-beta-3 (No enum constant LifecyclePhase.none) and@Executeis inherited, so no-fork mojos cannot opt out; worked around by reordering the classes.requiresDependencyResolutionand nothreadSafeattribute on@Mojo.PathScopeincludessystem, and none combines compile, provided, runtime and test. The resolver therefore drops system dependencies (probe:-classpathempty where 3.11.2 had the jar) and the runtime scope for test goals. Workaround: directsystemdependencies are read from the model'ssystemPath, test goals mergeTEST_COMPILEandTEST_RUNTIME. Transitive system dependencies stay missing.DependencyResolverResult.getDispatchedPaths()(what the jlink port uses) is not adopted for the module path: on a probe withrequires org.objectweb.asmonly, it still put the unrequired named module commons-lang3 onMODULES, and the result is the same before and aftercompile. The javadoc logic needs the main descriptor parsed frommodule-info.javasources (thejavadocgoal forks onlygenerate-sources),requires static, patch-module andAutomatic-Module-Namecases, which plexus-javaLocationManagerprovides; it depends on no Maven 3 type and stays. A switch would change which JARs go on the module path.${project.name}does not evaluate in parameter defaults and${project.model.name}has no artifact id fallback and stays literal when the project has no name; the titles are resolved in code.Project.getBuild().getSourceDirectory()/getResources()are not reliable in v4;ProjectManager.getEnabledSourceRootsis used. Project instances are not identity stable, so projects are compared by GAV.-s/-gs/-t/-gt, only the configured defaults (Constants.MAVEN_USER_SETTINGSetc.).SiteTool(doxia-integration-tools) is bound to Maven 3 types and Sisu: dropped, locale parsing reimplemented. PlexusArchiverManagercannot be injected:new JarArchiver()/ZipUnArchiverare used directly.propertymakeMojoExtensionthrow an NPE unless the test POM lists the element; an exact${project.basedir}evaluates to aPath, so aStringparameter stays null;ProjectStub.getLanguage()is null (the mojo treats a null language as Java); a test@Providesneeds@Singleton.Tests: the 13 stubs under
src/test/java/.../stubsare replaced byTestSessions(mock session with source roots, dependencies, artifact resolution from a local repo directory) and POM-based reactor projects; 37 test POMs list empty object arrays, use${project.basedir}, and three aggregate configs declare<modules>;stale-testdeclaresjarpackaging (it saidpom, which the old harness ignored). Added: default titles fall back to the artifact id, system scope class path, test goal runtime class path, locale parsing.Shared snapshots consumed:
maven-common-artifact-filters4.0.0-SNAPSHOT (frommaven-common-artifact-filters, branchagent/mvn4-api, already in the local repository). Released:maven-archiver4.0.0-beta-5,maven-reporting-api4.0.0.Improvements: drops
maven-core,maven-model,maven-settings,maven-plugin-api,maven-artifact,maven-plugin-annotations,maven-resolver-api/impl/util,javax.inject,maven-reporting-impl(javadoc link only),doxia-integration-tools, the Sisu index plugin, and the test dependenciesmaven-plugin-testing-harness, resolver connector/transport, Sisu; Mockito 4.11 β 5.24.Recommendation: port the non-report goals (
jar,test-jar,aggregate-jar,test-aggregate-jar,resource-bundle,test-resource-bundle) and directjavadoc:*use; they are complete and verified. Do not merge as a replacement for 3.x:mvn sitereporting breaks until maven-site-plugin, maven-reporting-impl and doxia-sitetools have v4 releases in that order, andcommon-artifact-filters4.0.0 must be released first. Keep a 3.x line. Open question for plugin-tools: make@Executecancellable (or acceptnone) so the no-fork mojos need not become base classes.maven-jdeprscan-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifyandmvn verify -Prun-itswith Maven 4.0.0-rc-7, JDK 21 β unit tests 3 before, 6 after (new:ToolchainSelectionTest, 3 tests), 0 failures; ITs 6 passed, 1 skipped before and after (invoker), 0 failures; spotless clean;dependency:analyze-onlyruns and passes.User-visible changes
<prerequisites>followsmavenVersion) and Java 17 (was Maven 3.6.3 / Java 8). It no longer runs under Maven 3.jdeprscan,test-jdeprscan,listand all parameters (failOnWarning,forRemoval,release,for-removal) keep their names, properties and defaults.@Mojo(threadSafe = true)is gone: the v4Mojoannotation andMojoDescriptorhave no thread-safety flag.listlosesrequiresDirectInvocation = true: the v4 annotation has no such attribute (the descriptor hasdirectInvocationOnly, the annotation cannot set it), soplugin.xmlnow saysdirectInvocationOnly=false. The goal has no default phase, so it is still not bound implicitly.requiresDependencyResolution(COMPILE / TEST) is replaced by an explicitDependencyResolver.resolve(session, project, PathScope.MAIN_COMPILE | TEST_COMPILE)in the mojo. The--class-pathorder is kept: classes directory (plus main classes fortest-jdeprscan), then dependencies.Gaps
ToolchainManagercovers both lookups the old code needed:getToolchainFromBuildContext(session, "jdk")andgetToolchains(session, "jdk", {version=[9,)}). The reflection fallback for Maven 3.3.0 is gone because the API has the method directly.Toolchain.findTool("jdeprscan")exists on the v4 interface, so no toolchain internals are needed.Improvements: drops
maven-core,maven-plugin-api,maven-model,javax.inject(constructor injection replaced by@Injectfields onSession,ToolchainManager,DependencyResolver,Log); adds onlymaven-api-core,maven-api-di,maven-api-model(provided). No new test dependency: the toolchain-selection test usesjava.lang.reflect.Proxystubs.commons-lang3andplexus-utils(Commandline,CommandLineUtils) stay because forking the tool has no v4 API.Recommendation: port; it is small and needs no shared component. Ship as 4.0.0-beta-1 on master and keep a 3.x line for Maven 3 users.
maven-jdeps-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 11 unit tests before and after, 0 failures;mvn verify -Prun-itsβ 7 passed, 0 failed, 2 skipped before (5m13s) and after (5m44s), the two skipped areunsupported-api_main/unsupported-api_test("SKIPPED due to JRE version", same before and after); spotless clean. Toolchain fallback checked by hand (see Gaps). Shared snapshots consumed: none.Public API changes (Mojo base class, for subclasses only)
AbstractJDepsMojoimplementsorg.apache.maven.api.plugin.Mojoinstead of extendingAbstractMojo;@Injectfields forLog,Project,Session,ToolchainManager(org.apache.maven.api.services),DependencyResolver. The(ToolchainManager)constructor is gone.getProject()returnsorg.apache.maven.api.Project;getClassesDirectory()returnsPath;getClassPath()no longer throwsDependencyResolutionRequiredException; new abstractgetPathScope().@Mojo(name, defaultPhase)with string phases;execute()throws the uncheckedMojoException.dotOutputis aPath. Goal names, parameter names and-Dproperties are unchanged.Gaps
@Resolutionfield injection does not work with maven-plugin-tools 4.0.0-beta-3: the generatedplugin.xmlhas no<resolutions>, the field stays null (NPE "this.resolution is null" in all 7 ITs). Maven core supports it (DefaultMavenPluginManagerreadsgetResolutions()), the descriptor generator does not write it (PluginDescriptorFilesGeneratoronly writesdependencyResolution). Worked around with an injectedDependencyResolverandresolve(session, project, PathScope)insideexecute().JDKInternalsMojoFactorycalls a no-arg constructor ("method 'void ()' not found"). Field injection only.threadSafe = truehas no v4@Mojoattribute; the flag is dropped, nothing replaces it.requiresDependencyResolutionhas no attribute either (onlydependencyResolutionPathScopes, whose generation I did not test). Resolution therefore happens on first use inside the mojo, not before it.getCompileClasspathElements()/getTestClasspathElements()included the project's own output directories; v4resolveDependenciesreturns dependencies only, so the mojos prependgetOutputDirectory(ProjectScope.MAIN/TEST)themselves.ResolutionScope.TESTmaps toPathScope.TEST_RUNTIME,COMPILEtoMAIN_COMPILE.project.getArtifacts()(used to matchdependenciesToAnalyzeIncludes) maps toDependencyResolverResult.getDependencies()keyed bygroupId:artifactId; same filtering.org.apache.maven.api.services.ToolchainManagerhasgetToolchainFromBuildContext(Session, "jdk")(Optional) andgetToolchains(Session, "jdk", Map), which replaces the 3.2.6 reflection hack;Toolchain.findTool("jdeps")is unchanged. Checked by hand with the installed plugin and atoolchains.xmlholding only zulu-8: jdeps ran fromzulu-8.jdk/.../bin/jdepswith the file and from thezulu-21.jdkJAVA_HOME with an empty<toolchains/>. Not tested: a toolchain selected bymaven-toolchains-plugin(the build-context branch). No IT exercises toolchains, before or after.User-visible changes
project,sessionare removed from the descriptor.src/site/markdown/index.mdstill describes Maven 3.2.6 toolchain behaviour and the workflow still lists JDK 8 inmatrix-exclude; neither was touched.Improvements: drops
javax.inject,maven-plugin-annotations,maven-plugin-api,maven-core,maven-model,maven-artifact; addsmaven-api-core,maven-api-di,maven-api-annotations(provided).commons-lang3andplexus-utilsstay (MatchPatterns,Commandline). The reflection onToolchainManager.getToolchainsis gone.Recommendation: port for the Maven 4 line, keep 3.x for Maven 3. Nothing in the plugin is blocked; the two tooling gaps (
@Resolutiondescriptor output, constructor injection) are worth a plugin-tools issue.maven-jlink-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifyandmvn verify -Prun-itswith Maven 4.0.0-rc-7, JDK 21 β unit tests 14 before (1 skipped, the Windows-only one), 17 after (1 skipped); ITs 28 passed, 1 skipped before and after (invoker, 23 min before, 21 min after); 0 failures; spotless clean;dependency:analyze-only(failOnWarning) passes. One removed test:getCompileClasspathElementsShouldSkipPomTypeArtifacts, because the code it covered (project.getArtifacts(), skippingpomartifacts) is gone; the resolver returns paths only. Four new tests for module-path resolution (plain JAR, directory without descriptor, projectmodule-info.class, project without it).Do the v4 APIs cover toolchains and module-path resolution? Yes for both, with two small workarounds.
ToolchainManager.getToolchains(session, "jdk", requirements),getToolchainFromBuildContext(session, "jdk"),Toolchain.findTool("jlink")andToolchain.matchesRequirements(...)replace the reflection ongetToolchains, theToolchainPrivatecast andJavaToolchainImpl. No gap.DependencyResolver.resolve(session, project, PathScope.MAIN_RUNTIME)replacesrequiresDependencyResolution = RUNTIME,project.getArtifacts()and plexus-javaLocationManager. On a probe project (asm 6.0 withmodule-info.class, commons-lang3,javax.inject:1with no module name)getDispatchedPaths()gaveJavaPathType.MODULES= asm, lang3 andCLASSES= javax.inject, i.e. the same split the old code made (module, module, skipped as automatic). The mojo usesgetPaths()plusDependencyResolverResult.getModuleDescriptor(path)because it needs the module name and the automatic flag; the resulting--add-modulesset was identical to the 3.x plugin's on the probe (asm, lang3, project).getModuleDescriptorreturns empty for the project's owntarget/classes, so the project'smodule-info.classis read withjava.lang.module.ModuleDescriptor.read.ResolvePathsRequest.setJdkHome). No IT or probe output changed; effect on system-module resolution is unmeasured.User-visible changes
<prerequisites>followsmavenVersion) and Java 17 (was Maven 3.6.3 / Java 11).additionalResourceselement type is noworg.apache.maven.shared.filtering.Resource(maven-filtering 4) instead of the modelResource;MJLINK-80_additionalResourcespasses with the same configuration.jlinkgoal keep names, properties and defaults.requiresDependencyResolutionis now an explicit resolve in the mojo.jlinkpackaging (artifact handler and lifecycle mapping) is still declared inMETA-INF/plexus/components.xml. Maven 4.0.0-rc-7 still honours it: every IT with<packaging>jlink</packaging>and<extensions>true</extensions>passes. The native SPI (TypeProvider,LifecycleProvider,PackagingProvider) was not adopted.Session.createProducedArtifact(..., classifier, "zip", "jlink")andProjectManager.attachArtifact; the unclassified one replaces the project's main artifact as before.projectHasAlreadySetAnArtifactnow asksProjectManager.getPath.Gaps
ProjectManageris not bound for@Inject; aProvidersclass with@Provides(as in maven-jar-plugin) supplies it. Same for plexus-build-api'sBuildContext, which maven-filtering 4 needs.ThreadBuildContextneedsorg.codehaus.plexus.logging, which the plugin realm does not see for a plainjarproject (MJLINK-52_classifiers_duplicate_classifierfailed loadingorg.codehaus.plexus.logging.AbstractLogEnabled);org.eclipse.sisu.plexusis declared for it (as maven-resources-plugin does) and whitelisted fordependency:analyze. Packaging-jlinkITs passed without it, so this is a class-loading difference between the two realms.maven-shared-utils3.5.0 (Commandline) and plexus-archiver stay: forkingjlinkand zipping have no v4 API.Improvements: drops
maven-core,maven-plugin-api,maven-model,maven-artifact,javax.inject,plexus-java,maven-plugin-annotations; theJavaVersion.isAtLeast("14")check for the no-toolchain case is dead on a Java 17 baseline and is reduced toRuntime.version().feature().Shared snapshots consumed: none.
maven-archiver4.0.0-beta-5,maven-filtering4.0.0-beta-1 andplexus-build-api0.0.7 are released versions.Recommendation: port; nothing blocks it. Keep a 3.x line for Maven 3 users. Open question for the list: whether to move the
jlinkpackaging to the v4 SPI or keepcomponents.xmlwhile Maven 4 honours it.maven-jmod-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β the module has no unit tests, before or after;mvn verify -Prun-itsβ 18 ITs passed, 0 failed before (12m27s) and after (9m16s); spotless clean, RAT anddependency:analyze-onlypass. Toolchain selection checked by hand (see Gaps). A first full IT run was cut short at the last IT (base-it) by a hung Maven process; the counts above are from a clean rerun after the final edit. Shared snapshots consumed: none.User-visible changes
-Dproperties are unchanged.jmodFile,modulePath,config,libs,outputDirectory,targetClassesDirectoryarePathinstead ofFile. Readonlyprojectandsessionleave the descriptor, and so does the unused readonlycompilePath(${project.compileClasspathElements}does not exist in v4).hashno longer declaresrequiresDependencyResolution = COMPILE; it never used the result (it builds a command line and does not run it, same as before).createresolves dependencies formain-runtime(compile and runtime, the same scopes as v3RUNTIME) insideexecute()throughDependencyResolver, not before the mojo.MojoFailureExceptionandMojoExecutionExceptionboth becomeMojoException, so failures like "JMODS folder does not exists" are no longer separated from execution errors in the exception type.ProjectManager.attachArtifact(project, project.getMainArtifact()); the "You have to use a classifier" check is kept, based onProjectManager.getPath(project).AbstractJModMojoimplementsorg.apache.maven.api.plugin.Mojo;@InjectfieldsProject,Session,ToolchainManager(org.apache.maven.api.services),Log; the(ToolchainManager)constructor andJModCreateMojo(ToolchainManager, LocationManager)are gone;getToolchain()returnsorg.apache.maven.api.Toolchain,getProject()the v4Project,executeCommand(Commandline, Path).Gaps
getToolchains(Session, "jdk", Map)replaces the reflection onMavenSession,getToolchainFromBuildContext(Session, "jdk")(Optional) replaces the 3.x call, andToolchain.findTool("jmod")is unchanged. Checked by hand with the installed plugin and atoolchains.xmlholding azulu-21symlink markedvendor=tc-test: with<jdkToolchain><vendor>tc-test</vendor></jdkToolchain>the debug line showsjmodfrom the toolchain path; without it, fromJAVA_HOME. Not tested: a toolchain selected bymaven-toolchains-plugin(build-context branch); no IT touches toolchains.JavaToolchainImpl.getJavaHome()has no v4 accessor (ToolchainhasfindTool,getModel,matchesRequirements), soResolvePathsRequest.setJdkHomenow gets the JDK home derived from thejmodexecutable, which only differs from v3 if a toolchain exists but provides nojmod.DependencyResolverResult.getDispatchedPaths()classifies each dependency alone fromType.getPathTypes()and the dependency's own module info;addOutputDirectory, which would take the project's ownmodule-info.class, is documented "currently not called" (DefaultDependencyResolverResult).createneeds the opposite: only modules reachable from the main module'srequiresgo on--module-path, the rest on--class-path,.jmoddependencies move to the module path, and filename-based automodules get a warning. That stays inplexus-javaLocationManager.resolvePaths(a plain library, now constructed withnew LocationManager()), fed with the files from the resolver.DependencyResolverResult.warningForFilenameBasedAutomodules()exists but I did not wire it, to keep the message and the boxed warning unchanged.JavaPathType.option(paths)returns two arguments (["--class-path", "a:b"]); the plugin passes--class-path=a:bwith backslashes doubled for jmod, so it does not use it.META-INF/plexus/components.xml(ArtifactHandlerandLifecycleMappingforjmod) still works, the ITs with<packaging>jmod</packaging>and<type>jmod</type>dependencies pass. rc-7DefaultPackagingRegistry.lookuponly consults a legacyLifecycleMappingand never thePackagingProviderbeans of a project extension (read inmaven-4.0.x, tag rc-7 plus 11 commits).@Inject ProjectManagerfails in a real build ("No binding to construct an instance for key ProjectManager" seen in the sibling rar port); usedsession.getService(ProjectManager.class).@Resolutionis not written toplugin.xmlbymaven-plugin-plugin4.0.0-beta-1, so the field stays null and dependencies would be silently dropped; I avoided it by injectingDependencyResolver. Nothing here would have caught it: no unit tests, and the ITs only fail if the jmod is wrong.maven-api-annotationshas to be declared (provided) ordependency:analyzefails with "used undeclared" after the port.maven-shared-utils3.5.0 (Commandline,CommandLineUtils,Os,StringUtils,FileUtils,MessageUtils) andplexus-java1.6.0 stay; neither is Maven API.jmod; JDK 24+ without ajmodsfolder (the existing JEP 493 message is unchanged, I ran JDK 21 only).Consumers that break: none in the Apache Maven plugin and shared-component repositories reference
maven-jmod-pluginor its classes; thejmodpackaging is consumed by user projects and, in the estate, only by this plugin's own ITs.Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-artifact,maven-plugin-annotations,javax.inject; addsmaven-api-core,maven-api-di,maven-api-annotations(provided). The reflection onToolchainManager.getToolchainsandJavaToolchainImplare gone.Recommendation: port for the Maven 4 line, keep 3.x for Maven 3. Not blocked. Two API requests for apache/maven: a main-module-aware dispatch in
DependencyResolverResult(wireaddOutputDirectory) soLocationManageris no longer needed, and a Toolchain accessor for the JDK home.maven-pmd-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally (Maven 4.0.0-rc-7, zulu-21, plugin-tools 4.0.0-beta-3, plugin-testing 4.0.0-beta-4):
mvn -B -ntp verify: 65 tests run, 0 failures, 0 errors, 8 skipped (Windows-only tests on macOS); BUILD SUCCESS.-Prun-its -DskipTests: 46 ITs, Passed 41, Failed 0, Skipped 5, 14m25s.mvn -B -ntp verify -Prun-its: 20 tests run, 0 failures, 0 errors, 8 skipped (same 8 Windows tests); ITs Passed 5, Failed 0 (5 new ITs, see below); BUILD SUCCESS, 1m36s.spotless:checkpasses; RAT and dependency:analyze ran in the same build.target/pmd.xml/cpd.xml(no PMD run): see "Key finding".What ported. Non-report goals
check,cpd-check,aggregate-pmd-check,aggregate-cpd-checkare v4 mojos (org.apache.maven.api.plugin.Mojo,@Inject Log/Project,MojoException). Report goalspmd,cpd,aggregate-pmd,aggregate-cpd,aggregate-pmd-no-forkare blocked: their sources stay in the tree but are excluded from compilation (pom<excludes>/<testExcludes>with a comment).Key finding: check does not need the report goal; the only coupling is a fork plus a file
check/cpd-check(and the aggregate variants) read exactly one file:${targetDirectory}/pmd.xml(cpd.xmlfor CPD), default${project.build.directory}. They never touch the report object, resolution, rulesets or PMD analysis. Only PMD library use:PMDVersion.VERSIONin the message, the modello xpp3 readers, andRuleViolationinExcludeViolationsFromFile.@Execute(goal = "pmd")/"cpd"/"aggregate-pmd"/"aggregate-cpd": before each check, Maven forks the report goal, which runsPmdExecutor/CpdExecutorand writespmd.xml/cpd.xml(XML is always produced,canGenerateReportInternalreturns true for xml even with no files, so check can run on an empty result). No other state is passed.mvn pmd:checkwith a handwrittentarget/pmd.xml(1 priority-3 and 1 priority-4 violation): BUILD FAILUREPMD 7.28.0 has found 2 violations. For more details see: .../target/pmd.xml;-Dpmd.verbose=true -Dpmd.failOnViolation=falseprints the twoPMD Failure:lines and BUILD SUCCESS;-Dpmd.failurePriority=2giveshas issued 2 warnings, BUILD SUCCESS;-Dpmd.skip=trueskips.cpd-check: fails oncpd.xmlwith 1 duplication, passes with-Dcpd.failOnViolation=false,-Dcpd.skipskips.Unable to perform check, unable to find .../target/pmd.xml;-eshowsCaused by: org.apache.maven.api.plugin.MojoException. v4 has no failure/error split: output reads the same as the old MojoFailureException ("Failed to execute goal ... on project x: message", BUILD FAILURE), and the same type is used for unreadable XML.pmd:checkruns per module, pom-packaging root skipped;pmd:aggregate-pmd-checkruns once on the root (module steps SKIPPED), reads roottarget/pmd.xml; deprecated-Daggregate=truewithcheckchecks only the top project (isExecutionRoot()becameProject.isTopProject()).@Execute(goal="pmd"), report sources excluded):Could not find goal 'pmd' in plugin ... among available goals aggregate-cpd-check, aggregate-pmd-check, check, cpd-check, help. Fails before any check logic. That is why@Executewas removed from the four check mojos in this port.pmdthat only writespmd.xml,checkannotated@Execute(goal = "pmd")(v4 annotation): rc-7 forks the v4 goal (>>> pmd:...:check > :pmd @ exp >>>, then--- pmd:check), check reads its output and fails as expected. So v4 fork v4 works; a v4 non-report producer goal can restore the originalcheckbehaviour.plugin.xmlwhose report mojos carry<requirements>(roleorg.codehaus.plexus.PlexusContainer,org.apache.maven.doxia.siterenderer.Renderer,org.apache.maven.doxia.tools.SiteTool; they come from@Componentfields ofAbstractMavenReportin reporting-impl 4.0.0). Maven 4.0.0-rc-7 then fails on every goal of the plugin:Failed to parse plugin descriptor ... ParseError at [row,col]:[357,7] Message: Unrecognised tag: '{http://maven.apache.org/PLUGIN/2.0.0}requirements'. A v4 and a v3-report mojo cannot share one artifact today. The already-proven chain (site plugin cast error, reporting-impl needing maven-core) stays as the reason the report goals cannot simply be ported.Aux classpath and ruleset resolution without Sisu
Ruleset resolution (
PmdReport.resolveRulesets, plexus-resourcesResourceManager):DefaultResourceManager(1.4.0) has a public constructor takingMap<String, ResourceLoader>; the loaders have public no-arg constructors. No Sisu needed:new DefaultResourceManager(Map.of(FileResourceLoader.ID, new FileResourceLoader(), URLResourceLoader.ID, new URLResourceLoader(), ThreadContextClasspathResourceLoader.ID, new ThreadContextClasspathResourceLoader(), JarResourceLoader.ID, new JarResourceLoader())).addSearchPath(FileResourceLoader.ID, dir)andsetOutputDirectory(out),getResourceAsFile("myrules.xml","001-myrules.xml")copies the file from the search path; a classpath resource (t/cp-rules.xml) is found through the thread-context classloader; a missing one throwsResourceNotFoundException. NOT exercised: http(s) rulesets (URLResourceLoader), and whether the TCCL is the plugin realm inside a v4 mojo (the ported plugin default rulesets live in plugin resources). The search paths the report adds map toproject.getPomPath().getParent(),project.getBasedir(), and the session base directory (v4:session.getRootDirectory()/top directory, not compared againstgetRequest().getBaseDirectory()).rulesetsTargetDirectorylogic,determineRulesetFilename,getLocationTempand the001-name.xmlnaming are plain Java.Aux classpath (
PmdReport.determineAuxClasspath+ConfigurationService):MavenProject.getCompileClasspathElements()/getTestClasspathElements()(needsrequiresDependencyResolution=TEST) and, for aggregation, an aetherCollectRequestthroughProvider<MavenSession>+RepositorySystem(both Sisu-injected), excluding reactor siblings and then adding each module's class dirs.aggregator=true,@Inject Session,session.getService(DependencyResolver.class),DependencyResolverRequest.builder().session(s).project(p).requestType(RESOLVE).pathScope(...),getPaths()), run on root + a (commons-io compile, javax.inject provided, junit test, slf4j-simple runtime) + b (depends on a):PathScope.MAIN_COMPILE= {COMPILE, PROVIDED, COMPILE_ONLY}: the same set asgetCompileClasspathElements(a gets commons-io + javax.inject).PathScope.TEST_COMPILE= {COMPILE, PROVIDED, TEST, TEST_ONLY} omits runtime deps;PathScope.TEST_RUNTIME= {PROVIDED, COMPILE, RUNTIME, TEST_RUNTIME, TEST} (adds slf4j-simple) is the match forgetTestClasspathElements.project.getOutputDirectory(ProjectScope.MAIN)and, for tests,ProjectScope.TEST, and keep the existingemptyOrNotExistingfilter.mvn compile, b's resolved paths containa/target/classes(a DIR) plus a's transitive commons-io. That replaces the v3 exclusion-list and per-module class-dir loop ofConfigurationService;aggregate-*only needs to loopsession.getProjects()(filtering to the aggregated modules by base directory, asmodulesForAggregatedProjectdoes) and call the resolver per project. NOT verified: behaviour withoutcompilein the same build (sibling would resolve to a jar/repo artifact), and system-scope deps.session.getService(ProjectManager.class).getEnabledSourceRoots(p, ProjectScope.MAIN|TEST, Language.JAVA_FAMILY)givessrc/main/javaand the generated-sources dir (prototype output). There is nogetCompileSourceRootsin rc-7ProjectManager;compileSourceRoots/testSourceRootsparameters (${project.compileSourceRoots}) need re-checking in a v4 build.org.apache.maven.toolchain.Toolchain/ToolchainManagerare no longer in maven-core 4.0.0-rc-7 (only in maven-compat). The v4 API isorg.apache.maven.api.Toolchainandorg.apache.maven.api.services.ToolchainManager(getToolchains(session,"jdk",map),getToolchainFromBuildContext(session,"jdk")returns Optional), obtained withsession.getService(...). The report-side edits below use it; they compiled before the sources were excluded, but were never run.Public API changes
AbstractPmdViolationCheckMojo<D>:extends AbstractMojobecomesimplements org.apache.maven.api.plugin.Mojo; fieldprojectisorg.apache.maven.api.Project(@Inject, no longer a${project}parameter);logvia@Inject Log,getLog()kept;targetDirectoryisPathwithdefaultValue=${project.build.directory}(propertyproject.build.directorykept);execute()throwsMojoExceptiononly.@Mojoisorg.apache.maven.api.plugin.annotations.Mojo(defaultPhase="verify";threadSafehas no v4 attribute and is dropped);@Executeremoved from all four.ExcludeFromFile/ExcludeViolationsFromFile/ExcludeDuplicationsFromFile.loadExcludeFromFailuresDatathrowMojoException(wasMojoExecutionException);AbstractPmdReport.getPmdVersion()no longer used by check (PMDVersion.VERSION).ServiceExecutor,PmdServiceExecutor,CpdServiceExecutor,PmdReport,AggregatorPmdReport,AggregatorPmdNoForkReportlost theToolchainManagerconstructor parameter and use the v4 toolchain API;CpdExecutor/PmdExecutorcatchMojoException.javaVersion17;mavenVersion4.0.0-rc-7;<prerequisites><maven>is${mavenVersion}; plugin-tools 4.0.0-beta-3; plugin-testing 4.0.0-beta-4.Gaps
pmd,cpd,aggregate-pmd,aggregate-cpd,aggregate-pmd-no-fork) blocked: plugin.xml<requirements>parse error above, plus the proven reporting chain. Not ported, not running.checkneeds apmd.xml/cpd.xmlfrom elsewhere (an older plugin'spmd:pmd, the PMD CLI, or a future v4 goal).exec/*) is not ported. Its only hard ties to the report API areMavenReportExceptionand the classloader fork path:Executor.buildClasspath()walksURLClassLoader.getURLs()of the plugin realm and ofConsoleLogger's classloader (plexus-container-default from core); not exercised on Maven 4.isExecutionRoot:Project.isTopProject()is used; difference fromMavenSession.isExecutionRoot()with-f/-plnot tested.MojoFailureExceptionvsMojoExecutionException): oneMojoException.src/testleft in the tree):CpdReportTest(13),PmdReportTest(26),PmdReportNumberOfThreadsTest(5),exec/ExecutorTest(1); helpersCapturingPrintStream(needsorg.slf4j.impl.MavenSlf4jSimpleFriend, which no longer ships with Maven 4),DependencyArtifactStubFactory,stubs/**(v3MavenProjectstubs). Also the 46 pre-existing ITs are not selected (<pomIncludes>ischeck-*/pom.xml): they runclean site,pmd:pmdor a forkedpmd:check. Test dependencies only those tests used were removed: wiremock, commons-io, commons-lang3, maven-embedder, maven-resolver-* (the Maven 3 resolver 1.9.27providedjar also broke the v4 harness withNoClassDefFoundError: org/eclipse/aether/collection/VersionFilterBuilder).PmdViolationCheckMojoOnWindowsTestported identically (8 tests) but only skipped here (macOS).@Mojo(aggregator=true)under-T,Projectinjection on projects loaded from-fother poms.User-visible changes
pmd,cpd,aggregate-pmd,aggregate-cpd,aggregate-pmd-no-fork.<reporting>entries for this plugin andmvn siteoutput (HTML report, xref links) are gone.check,cpd-check,aggregate-pmd-check,aggregate-cpd-checkno longer run PMD/CPD first. A build that boundchecktoverifyand relied on the fork now fails withUnable to perform check, unable to find <dir>/pmd.xmlunless an earlier step produced the file.failOnViolation,failurePriority,maxAllowedViolations,excludeFromFailureFile,verbose,printFailingErrors,skip, deprecatedaggregate,targetDirectory).projectis no longer a configurable parameter.${basedir}in parameter values is not expanded by v4: use${project.basedir}(two unit-test poms changed for that).threadSafeflag not declared on the mojos.-enamesorg.apache.maven.api.plugin.MojoException.Improvements
META-INF/maven/org.apache.maven.api.di.Inject, no hand upkeep needed here,<proc>is notnone), plexus-utils, plexus-resources, plexus-i18n, doxia-core/sink-api, maven-reporting-api/impl, slf4j-api; sisu-maven-plugin and animal-sniffer-maven-plugin removed (itsjava18signature would reject Java 17 APIs). Kept: pmd-core (needed), pmd-java/javascript/jsp runtime (only the excluded report goals need them), plexus-xml (xpp3 readers).run-itsprofile) that run the goals against precomputed results inresults/with<targetDirectory>${project.basedir}/results</targetDirectory>: fails on 2 violations;failurePriority=3withverbosegives1 violation and issued 1 warning;cpd-checkwithfailOnViolation=falsesucceeds; missing results fail with the message;aggregate-pmd-checkon a pom root checks only the root.Recommendation
Land the check goals as a v4 plugin slice now and do not try to keep the reports in the same artifact until plugin-tools/Maven accept v3 report mojos in a 2.0.0 descriptor. Next step for a usable v4 plugin: a non-report producer goal (
PmdExecutor/CpdExecutorwithMojoExceptioninstead ofMavenReportException, rulesets via the hand-builtDefaultResourceManager, aux classpath viaDependencyResolverwithMAIN_COMPILE/TEST_RUNTIMEplus own output dirs, toolchain viaapi.services.ToolchainManager), which the check goals can fork with the v4@Execute(goal=...)(E3 shows that works). The HTML report then stays with the 3.x line or a separate artifact once the reporting chain moves.maven-rar-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported (packaging registration stays on the Maven 3 component model), 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 4 unit tests before, 5 after, 0 failures, 0 skipped;mvn verify -Prun-itsβ 3 ITs passed, 0 failed before (3m08s), 4 passed, 0 failed after (2m42s), the fourth (dependencies) is new; spotless clean, RAT anddependency:analyze-onlypass in the verify run. The unit tests were rewritten for the v4 harness (maven-testing), so the counts are not like-for-like: the three former tests are kept, plus one for optional and non-library dependencies. Shared snapshots consumed: none (maven-archiver 4.0.0-beta-5 and maven-filtering 4.0.0-beta-1 are released).User-visible changes
-Dproperties are unchanged. Readonlysessionandprojectleave the descriptor;threadSafe = truehas no v4@Mojoattribute and is dropped.RarResource(the<rarResources>element type) now extendsorg.apache.maven.shared.filtering.Resourceinstead oforg.apache.maven.model.Resource; the XML elements are the same.rarSourceDirectory,raXmlFile,manifestFile,outputDirectoryarePathinstead ofFile;getBuildDir()andgetRarFile(...)(protected) change toPath.main-runtimeinsideexecute(); the v3 mojo declaredrequiresDependencyResolution = TEST, so test-scope dependencies are no longer resolved and an unresolvable test dependency no longer fails the goal.Typehas path types (class path or module path); that replacesArtifactHandler.isAddedToClasspath(). Apomorrardependency is left out by construction (RarArtifactHandlersetsaddedToClasspath=false); onlyjar, optional and test scope are covered by a test.classifieris now treated as no classifier and sets the main artifact. I did not measure what the v3 mojo did with the empty default.@Parameterdefaults use${project.basedir}(see Gaps).Gaps
RarLifecycleMappingProvider(Provider<LifecycleMapping>) andRarArtifactHandlerstill usejavax.injectandmaven-coreclasses (org.apache.maven.lifecycle.mapping.*,DefaultArtifactHandler), somaven-coreandjavax.injectstay asprovideddependencies.maven-api-spihasPackagingProvider,TypeProviderandLifecycleProvider, but in rc-7DefaultPackagingRegistry.lookuponly looks up a legacyLifecycleMappingby id, and its provider list is injected at construction, so a provider shipped by a project extension is never consulted (read inmaven-4.0.x, tag rc-7 plus 11 commits). Thedefault-extensionIT passes with the legacy classes.@Inject ProjectManagerfails in a real build: "No binding to construct an instance for key ProjectManager" (themaven-testingharness does bind it, so the unit tests were green). Workaround:session.getService(ProjectManager.class).@Resolutionfield injection is not usable:maven-plugin-plugin4.0.0-beta-1 writes no resolution intoplugin.xml, the field stays null. My first port copied no dependencies and passed all unit tests and the 3 existing ITs, none of which has a dependency. Fixed with an injectedDependencyResolverandresolve(session, project, PathScope.MAIN_RUNTIME); the newdependenciesIT guards it. I did not run a negative control against the@Resolutionversion.${basedir}is not expanded in a v4@Parameter(defaultValue)(the work directory ended up as<basedir>/${basedir}/src/main/rar);${project.basedir}is. The harness does not expand${basedir}in plugin configuration either, so the tests set path parameters in code.maven-filtering4.0.0-beta-1 needs aBuildContextbinding, so the plugin addsProviders(@Provides BuildContext) andplexus-build-api0.0.7;ThreadBuildContextextends PlexusAbstractLogEnabled, soorg.eclipse.sisu.plexus1.1.0 stays on the plugin class path (NoClassDefFoundErrorwithout it).MavenArchiver.createArchive(maven-archiver 4.0.0-beta-5) takes the v4SessionandProjectand throws uncheckedMavenArchiverException;archive.setManifestFiletakes aPath.JarArchiveris no longer injectable, so the mojo doesnew JarArchiver().filterRarSourceDirectorywith delimiters (only the existingfilteredIT).Consumers that break: none in the Apache Maven plugin and shared-component repositories use its classes.
maven-ear-pluginonly listsmaven-rar-plugin:${mavenRarPluginVersion}as an IT extra artifact and stays on the 3.x version until bumped.Improvements: drops
maven-plugin-api,maven-core(only for the packaging registration, see Gaps),maven-model,maven-artifact,maven-plugin-annotations,plexus-utils,junit4,junit-vintage-engine,maven-plugin-testing-harness3.x and the five Maven 3 project/artifact test stubs; addsmaven-api-core,maven-api-di(provided),maven-testing,mockito-core(test) and the two runtime dependencies named under Gaps.Recommendation: port for the Maven 4 line, keep 3.x for Maven 3. Not blocked; the packaging registration should move to the SPI once
DefaultPackagingRegistryconsultsPackagingProviderfor project extensions, which is an API request for apache/maven. Worth a plugin-tools issue:@Resolutionis not written toplugin.xml.slachiewicz commentedon Sep 30, 2026
Wave 4 findings, part 4 of 4: maven-scm-publish-plugin to maven-toolchains-plugin, then maven-changes-plugin and maven-project-info-reports-plugin
Each plugin is a local branch
agent/mvn4-apiwith a "Build with Maven 4 only" commit and a "Port to the Maven 4 API" commit; the PRs are not opened yet.maven-remote-resources-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported (reduced supplemental-model merging, see Gaps), 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verify -Prun-itswith Maven 4.0.0-rc-7, JDK 21 β 11 unit tests, 9 failsafe ITs and 7 invoker ITs before (8:39 min), 11, 9 and 7 after (4:10 min), 0 failures; spotless clean. The unit test class is rewritten (see Gaps), the ITs are untouched.Snapshots consumed from the local repository (not rebuilt here):
maven-filtering4.0.0-beta-2-SNAPSHOT,maven-archiver4.0.0-beta-6-SNAPSHOT (org.apache.maven.shared),maven-common-artifact-filters4.0.0-SNAPSHOT (the agent/mvn4-api port).v4 equivalents
ProjectBuilder.build(Artifact, request)βMavenProjectSession.resolveArtifactof thepomartifact, thenModelBuilder.newSession().build(ModelBuilderRequestβ¦requestType(CONSUMER_DEPENDENCY).source(Sources.resolvedSource(pom, key)))βgetEffectiveModel().api.ProjectBuilderis unusable here:ProjectBuilderResult.getProject()is empty for a repository POM becauseDefaultSession.getProjectreturns null when the project has no base directory.BUILD_EFFECTIVEfails on invalid dependency POMs ('distributionManagement.status' must not be specifiedformaven-plugin-api:2.0);CONSUMER_DEPENDENCYtolerates them likeVALIDATION_LEVEL_MINIMALdid (MRRESOURCES-121 IT).MavenProject.getArtifacts()/getDependencyArtifacts()Session.collectDependencies(project, TEST_RUNTIME)flattened /root.getChildren(), asDependencysets fed to the v4 common-artifact-filtersRepositorySystem.resolveArtifact+ArtifactHandlerManagerSession.requireType(type)(extension, classifier) +Session.resolveArtifact(artifact, ProjectManager.getRemoteProjectRepositories(project))MavenSession.getProjects()output dirsProject.getOutputDirectory(ProjectScope.MAIN / TEST)project.getResources().add(Resource)ProjectManager.addSourceRoot(project, scope, Language.RESOURCES, path)project.getResources()iterationProjectManager.getEnabledSourceRoots(project, MAIN, Language.RESOURCES),SourceRoot.stringFiltering()MavenXpp3Readerfor supplementsModelXmlFactory.read(XmlReaderRequest)ResourceManagerinjectionnew DefaultResourceManager(Map<id, loader>)built by hand; still exposed as$locatorVelocity context objects
projectand each element ofprojects:MavenProjectβRemoteResourcesProject(new, public), a wrapper over the immutableorg.apache.maven.api.model.Modelwith the descriptive getters (groupId,artifactId,version,packaging,name,description,url,inceptionYear,organization,licenses,developers,contributors,mailingLists,scm,issueManagement,ciManagement,distributionManagement,build,dependencies,properties,id,basedir,model). Returned values are v4 model classes (same getter names);propertiesis aMap<String,String>.$project.artifactkeeps the textual formgroupId:artifactId:type:version(type = the model packaging), so the bundledDEPENDENCIEStemplate output is unchanged (MRRESOURCES-121 assertsβ¦maven-plugin-api:jar:2.0). The object is no longer anArtifact(nogetFile()).projectsSortedByOrganizationkeys areorg.apache.maven.api.model.Organization;projectssort by groupId, artifactId, version.presentYear,projectTimespan,locator, userproperties.MavenProject-only method (getFile,getParent,getArtifacts,getBuild().getResources()as mutable, β¦); templates using them need$project.model.Public API changes
org.apache.maven.api.plugin.Mojo;@Injectfields (Session,Project,Log,MavenFileFilter); constructors are no-arg (a constructor with parameters fails at lookup: the generatedβ¦MojoFactorycalls<init>()). ProtectedmavenSessionβsession(api.Session),projectisapi.Project; abstractgetAllDependencies()/getDirectDependencies()returnSet<org.apache.maven.api.Dependency>;getProjects()returnsList<RemoteResourcesProject>;getSupplement,mergeModelsuseapi.model.Model.ModelInheritanceAssembler.assembleModelInheritancereturns the mergedModelinstead of mutating;ModelUtilsis removed.${basedir}/src/main/resourcesand${basedir}/src/main/appended-resourcesbecame${project.basedir}/β¦: Maven 4 does not evaluate${basedir}in@Parameterdefaults (thebundlegoal silently skipped with "skip non existing resourceDirectory ${basedir}/src/main/resources").Gaps
SourceRootis immutable, so a project resource that overrides a bundle resource is no longer excluded from the project's resources (resource.addExclude); both copies reach the resources plugin. ITFilterLocalOverride and ITGenerateFromOverride pass.maven-impl's assembler is internal). They only matter if a template reads them. ITSupplementalArtifact passes.requiresDependencyResolution = TESThas no attribute in use; dependencies are collected on demand.resolveScopeswas already unused.BuildContext:Providers(@Named,@Provides ThreadBuildContext) plusplexus-build-apiandorg.eclipse.sisu.plexusat runtime (forAbstractLogEnabled), as in maven-resources-plugin.RemoteResourcesMojoTestno longer usesAbstractMojoTestCaseand is rebuilt on Mockito mocks ofSession/Project/ProjectManager(same 11 scenarios, renamed to camelCase). Removed, with reason:stub/ArtifactStub,MavenProjectBasicStub,MavenProjectBuildStub,MavenProjectResourcesStub,ModelStub(v3MavenProjectstubs with no v4 counterpart),src/test/resources/unit/rrmojotest/*.xml(mojo configs for the old lookup harness). The unit tests therefore do not exercise real dependency resolution; the ITs do.User-visible changes: requires Maven 4; Velocity templates that call
MavenProjectmethods beyond the list above break; the${basedir}defaults are now${project.basedir}; local resources overriding a bundle are copied twice (same content). ASF parent POMs bind this plugin, so they need the 4.x plugin on Maven 4 only. No Java code under the Apache Maven repositories importsorg.apache.maven.plugin.resources.remote.Improvements: drops
maven-core,maven-model,maven-model-builder,maven-plugin-api,maven-artifact,maven-resolver-api/provider/util,maven-plugin-annotations,javax.inject, and from tests junit4, the vintage engine,maven-plugin-testing-harnessandmaven-resolver-impl; addsmaven-api-core/annotations/model/di(provided),plexus-build-api,mockito-core5.24.0 (tests, replaces the harness stubs).Recommendation: port for Maven 4; keep the 3.x line for Maven 3. Ask core for a
ProjectBuilderresult that works for repository POMs (or documentModelBuilder+CONSUMER_DEPENDENCY), and for a documented${basedir}alias in parameter defaults.maven-scm-publish-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β no unit tests exist, before or after;mvn verify -Prun-itsβ 5 passed, 0 failed before (5m09s) and after (4m57s); spotless clean. Also run by hand with the installed plugin: credentials from a settings<server>(see Gaps) and a no-project publish to a local bare git repo (BUILD SUCCESS, commit andindex.htmlpresent, seed file deleted as expected). Shared snapshots consumed: none (maven-scm 2.2.1 release; the maven-scm library modules use no Maven API and are used unchanged; maven-release-manager is dropped, not ported).Public API changes (Mojo base classes, for subclasses only)
AbstractScmPublishMojoimplementsorg.apache.maven.api.plugin.Mojo; constructor(ScmManager, ScmRepositoryConfigurator)is gone;@InjectfieldsLog,Session,Prompter;ScmPublishPublishScmMojo.projectis noworg.apache.maven.api.Project; thesettingsfield is gone;execute()/scmPublishExecute()throw the uncheckedMojoException.@Mojo(projectRequired = false, aggregator = true)replacesrequiresProject = false.ScmManagerFactory(builds theScmManager).Gaps
ScmManagerandScmRepositoryConfiguratorcannot be injected. Both are Sisu JSR 330 components (META-INF/sisu/javax.inject.Named), which the v4 plugin container does not read, andScmRepositoryConfigurator.getConfiguredRepository(ReleaseDescriptor, org.apache.maven.settings.Settings)takes the v3Settingstype, whichSession.getSettings()(org.apache.maven.api.settings.Settings) does not provide. I did not try to keepmaven-release-manager. Replacement:ScmManagerFactoryreads the Sisu index from the plugin class loader, instantiates each@NamedScmProvider(first hint wins, as inDefaultScmManager) into aBasicScmManager; debug log showsgit,jgit,hg,svnregistered. A provider needs a no-arg constructor or the PlexusPrompterconstructor (jgit, served by an adapter over the v4org.apache.maven.api.services.Prompter); any other is skipped with a warning. This is the piece maven-scm would have to fix properly (a non-Sisu way to obtain aScmManager, such as aServiceLoaderregistry).Session.getSettings().getServers()is a plain list, so thegetServer(id)lookup and the host fallback (host[:port]) are reimplemented in the mojo, along with the username/password/privateKey/passphrase precedence ofDefaultScmRepositoryConfigurator. The v4 API has no decrypt service; Maven 4'sDefaultSettingsBuilderdecrypts settings itself (read in the maven-4.0.x checkout at e8fd05a), so the mojo uses the values as given. Not run against an encrypted password. Observed:svn --username alice --password ...taken from<server id="myserver">via${project.model.distributionManagement.site.id}.${project.distributionManagement.site.url}and${project.name}do not evaluate in v4 (the evaluator reflects onapi.Project, which has no such getters). The first ITs failed with "The scm url cannot be null". Defaults are now${project.model.distributionManagement.site.url|id}and${project.model.name};${project.reporting.outputEncoding}still resolves as a property.${settings}and${project}parameters have no v4 form; replaced bySession.getSettings()and an injectedProject. WithprojectRequired = falseand no pom, the injectedProjectis null and the mojo handles it (publish without a project verified).maven-shared-utilsMessageUtils(deprecated; the v4MessageBuilderFactoryexists),Model.getModules()andScmProviderRepository.setPersistCheckout(deprecated).User-visible changes
settingsandprojectremoved; all other parameter names, properties and themaven.site.deploy.skipalias are unchanged (alias present in the generatedplugin.xml).pubScmUrl,serverIdorcheckinCommentare unaffected. Without a project the default checkin comment still contains the literal${project.model.name}(Maven 3 behaviour not compared).Improvements: drops
maven-release-api,maven-release-manager,maven-core,maven-model,maven-settings,maven-plugin-api,maven-plugin-annotations; adds themaven-api-*jars (provided).javax.injectmoves from provided to runtime (needed to read@Namedhints; providers already depend on it) andplexus-interactivity-api1.4 becomes explicit (already transitive via the jgit provider; the adapter implements its interface).Recommendation: port for the Maven 4 line, keep 3.x for Maven 3. The port works, but the in-plugin provider bootstrap is a workaround; ask maven-scm for a non-Sisu
ScmManagerfactory before releasing.maven-scripting-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn verifywith Maven 4.0.0-rc-7, JDK 21 β 1 test before and after, 0 failures;-Prun-its5/5 ITs pass before and after (whole suite, no time-box hit); spotless clean. Not measured: running the ported plugin under Maven 3.Uses
maven-api-core/maven-api-di/maven-api-annotations4.0.0-rc-7 (provided) and plugin-tools 4.0.0-beta-1. No shared component needed.User-visible changes
scripting:evaland its parameters (engineName,script,scriptFile,scriptResource) are unchanged.Mojo,@Inject).GLOBAL_SCOPEBindingspassed to every engine): the names stayprojectandlog, the types change.project:org.apache.maven.project.MavenProjectβorg.apache.maven.api.Project. Still there:groupId,artifactId,version,basedir(nowjava.nio.file.Path, wasFile),model,build(noworg.apache.maven.api.model.Build),parent(nowOptional<Project>),artifacts(nowList<ProducedArtifact>). Gone:getFile()(usepomPath),getProperties()(usemodel.properties),getName()/getDescription()(usemodel.name/model.description),getCollectedProjects(),getArtifact(),getRemote*Repositories(),getPluginArtifacts(),getCompileSourceRoots().log:org.apache.maven.plugin.logging.Logβorg.apache.maven.api.plugin.Log.debug/info/warn/errorwithCharSequenceand/orThrowable, andisXxxEnabled(), are present; the(CharSequence, Throwable)overloads exist too.sessionbinding before or after; not added.Maven-Scripting-Java-Engine): the generated class now importsorg.apache.maven.api.Projectandorg.apache.maven.api.plugin.Log, so$projectand$logchange type the same way. The engine's compile classpath is${maven.home}/lib/maven-*plus the test/plugin classpath; on Maven 4 that includesmaven-api-core, so it compiles.project.artifactId(the 4 Groovy ITs) work unchanged; Groovy property access maps onto theProjectgetters.MojoExecutionException(script error) andMojoFailureException(no engine for name/extension) both becomeMojoException, so the "BUILD FAILURE" vs "error" distinction is gone.ContextAwareEngine.setLog(Log)is public API for custom engines: parameter type is now the v4Log.Gaps: none. Everything used has a v4 equivalent.
Improvements: drops
maven-plugin-api,maven-core,maven-plugin-annotations.<prerequisites><maven>follows${mavenVersion}.Recommendation: port; publish as a 4.x line and keep 3.x for Maven 3 users. Release notes must list the binding type change, since user scripts are the only "consumers" and they are not visible to us.
maven-shade-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally:
mvn -B -ntp verifywith Maven 4.0.0-rc-7, JDK 21 β 72 unit tests before and after, 0 failures, 0 skipped;mvn verify -Prun-itsβ Passed 85, Failed 0, Skipped 1 before (19m39s, contended by other builds) and after (13m59s); the skipped IT isMSHADE-185("SKIPPED due to JRE version") both times, so the system-scoped-dependency path of the reduced POM is unexercised.spotless:checkclean. Shared snapshots consumed: none. Not measured: parallel (-T) builds beyond the existingMSHADE-413-parallelIT, JDK 17.Public API changes
Shader.shadethrows the uncheckedorg.apache.maven.api.plugin.MojoExceptioninstead of checkedMojoExecutionException. Third-partyShaderimplementations break at compile time and need@Named("<hint>")fromorg.apache.maven.api.diplus an entry inMETA-INF/maven/org.apache.maven.api.di.Inject(<proc>none</proc>in the parent, so nothing generates it for test classes).DefaultShaderis@Named("default")with@Injecton the no-arg constructor.MinijarFilterpublic constructors:(MavenProject, Log, ...)becomes(String projectId, Path projectArtifact, Path outputDirectory, Map<String,Path> dependencies, Log, ...);Logisorg.apache.maven.api.plugin.Log.UseDependencyReducedPom.createPomReplaceTransformers(MavenProject, File)takesorg.apache.maven.api.Project;ShadeMojo.updateExcludesInDeps(MavenProject, List, List)becomes(List, List)overorg.apache.maven.api.model.Dependency.org.apache.maven.plugins.shade.pom.PomWriter,MavenJDOMWriter(1941 lines) andCounter; the reduced POM is written withModelXmlFactory.ResourceTransformer,ReproducibleResourceTransformer,Relocator,Filterand every built-in transformer. None references a Maven type, so third-party transformers recompile as they are (MSHADE-363_old-Transformerpasses with a Spring Boot transformer on the plugin classpath).jdom2andplexus-utilsstay because built-in transformers use them.ShadeMojoimplementsorg.apache.maven.api.plugin.Mojowith@InjectLog/Session/Project/Map<String,Shader>; new package-privateResolvedArtifactreplacesorg.apache.maven.artifact.Artifactinside the mojo.Gaps
MavenProject.setFile(dependencyReducedPom);Projecthas no setter, andArtifactManager.setPath(project.getPomArtifact(), drp)has no effect on install (tried: installed-build.pomstill lists the shaded dependency). The call is dropped. Measured on Maven 4 with the 3.6.3 plugin:setFileonly changed the installed*-build.pom; the consumer POM (*.pom) is generated from the model and still lists the shaded dependency. So Maven 4 core, not the plugin API, decides what consumers see; a model-level hook would be needed.ArtifactManager.getPath(project.getMainArtifact()). Attached artifacts useProjectManager.attachArtifact(project, session.createProducedArtifact(g, a, v, classifier, ext, null), path); classified sources/tests resolve throughsession.resolveArtifact(coordinates, projectManager.getRemoteProjectRepositories(project)).getMainArtifact()is empty forpompackaging.ProjectBuildercannot re-read the reduced POM:DefaultProjectBuilder.doBuildbuilds a bareProjectBuildingRequest(no root directory, properties or profiles), so a parent reachable only throughrelativePathfails with "Non-resolvable parent POM" (dep-reduced-pom-with-local-parent). The port collects the dependencies it just wrote (DependencyResolverRequestwithrootArtifact,dependencies,managedDependencies,verbose(true),TEST_RUNTIME) instead. Consequences: the written POM is no longer parsed back, so a malformed reduced POM is no longer caught in the plugin, and the MSHADE-467 lock around the build is gone.DependencyCoordinatesFactory.create(Session, org.apache.maven.api.model.Dependency)drops scope, optional and exclusions (it passes only g:a:v:classifier:type). With it the graph lostprovidedand the exclusions anddep-reduced-pom-artifactset-provided-excludes(MSHADE-311) failed. The mojo fillsDependencyCoordinatesFactoryRequestitself and implementsapi.Exclusion.threadSafeand norequiresDependencyResolutionon@Mojo: dependencies are resolved inexecute()withDependencyResolver.resolve(session, project, PathScope.MAIN_RUNTIME);getDependencies()is aLinkedHashMap, so jar order (first wins on duplicate resources) is kept. No IT isolates the ordering.MavenProject.getOriginalModel()has no equivalent; the raw model is read fromproject.getPomPath()withModelXmlFactory(strict(false)).Shaderpicks an arbitrary implementation once a build adds another (shading-with-java-8-sourceshas the test jar withMockShaderon the plugin classpath and sets noshaderHint, and it ranMockShader); the mojo injectsMap<String,Shader>and looks upshaderHintordefault. A class with two constructors needs@Injecton one.${basedir}/dependency-reduced-pom.xmldoes not evaluate in v4 (created a literal${basedir}path); now${project.basedir}/..., same value.parent.relativePath(Set <relativePath/> in dependency-reduced-pom.xml to avoid false parent cycle in Maven 4Β maven-shade-plugin#813, [MNG-7602] Move back model version from 5.0 to 4.2 and reactivate modello site generationΒ #843, both open): master does not fix it. On rc-7 a project with<relativePath/>in its parent fails atshadewith'parent.relativePath' ... points at 'pom.xml' which resolves to org.example:app-emptyrel instead of the declared parent; the..layout from Make sure RAT plugin ignores files in the target folderΒ #813 did not fail on rc-7 with master's code in my repro. Root cause: the 3.x code resolves an empty relativePath against the basedir and writespom.xml. The port keeps an empty path empty, and leaves an unset path unset: the v4 model writer writes every non-null field, so writing the computed../pom.xmlmade Maven 4 reject the reduced POM (verified withmvn -f dependency-reduced-pom.xml validate). Not the approach of [MNG-7602] Move back model version from 5.0 to 4.2 and reactivate modello site generationΒ #843 (empty path when..is not the real parent); that PR's case and mine are different inputs.generateUniqueDependencyReducedPomunder load,MSHADE-185system scope (IT skipped), mojo configuration of third-party transformers that need injection.User-visible changes
-Dproperties are unchanged;threadSafeis not declared.https://maven.apache.org/xsd/maven-4.0.0.xsdinschemaLocation, default values (<relativePath>../pom.xml) omitted; all reduced-POM ITs pass.*-build.pom(on Maven 4 the 3.6.3 plugin published the reduced one there); the consumer POM is unchanged by either.<relativePath/>in the shaded project's parent now works on Maven 4 (fails on master).mvnup(PluginUpgradeStrategy) upgrades shade to at least 3.5.0 and skips projects with custom transformers; it knows nothing of 4.x.Improvements: drops
maven-plugin-api,maven-core,maven-model,maven-artifact,maven-resolver-provider,maven-plugin-annotations,javax.inject,sisu-maven-plugin, and about 2000 lines of generated JDOM writer; addsmaven-api-core,maven-api-di,maven-api-model,maven-api-annotations(provided). Test scope:junit-vintage-engine,junit(explicit) andmaven-plugin-testing-harnessgo;guiceis added forTransformerTesterRule(sisu.plexus needed it andmaven-coreno longer supplies it);junit/hamcrest-corestay independencyManagementbecausexmlunit-legacypulls junit 4 in and surefire then starts the vintage engine.Tests rewritten, none removed:
ShadeMojoTest(5 tests) from JUnit 3AbstractMojoTestCaseto JUnit 5 with Mockito andnew DefaultShader();MinijarFilterTest(2 tests) from aMavenProjectmock to the new constructor. 72 tests before and after. Newsrc/test/resources/META-INF/maven/org.apache.maven.api.di.InjectlistsMockShader.Recommendation: port for the Maven 4 line, keep 3.x for Maven 3. Two things block a full-parity claim: the reduced POM cannot become the published POM through any v4 API (a core/consumer-POM question to raise on apache/maven), and the
ProjectBuilderrequest cannot carry session context. Worth issues:DependencyCoordinatesFactory.create(Session, model.Dependency)dropping scope/exclusions, andProjectBuilderRequestlacking root directory/properties. Consider folding the<relativePath/>fix into a 3.x PR against #813/#843 first, since master is broken for that input today.maven-toolchains-plugin: ported
Branch
agent/mvn4-api; PR not opened yet. Status: ported, 4.0.0-beta-1-SNAPSHOT, Java 17. All four goals onorg.apache.maven.api; no test or IT removed.Verified locally: Maven 4.0.0-rc-7, JDK 21.
mvn -B -ntp verify: 1 test (ToolchainDiscovererTest), 0 failures, before and after.-Prun-its: 8 of 8 ITs before (old plugin on Maven 4), 8 of 8 after.display-discovered-jdk-toolchainsandgenerate-jdk-toolchains-xmlhave no IT; both were run by hand against the built plugin and print/write the 5 local JDKs. Spotless clean.Do the goals still have a job under Maven 4? Yes, both
toolchainandselect-jdk-toolchain. rc-7DefaultToolchainManageronly stores and reads the build context (toolchain-<type>); nothing in core selects and stores a toolchain. Core points at this plugin:checkJdkSourceLevelCompatibilitylogs "run 'mvnup' to add the maven-toolchains-plugin" and mvnupToolchainPluginStrategyaddsselect-jdk-toolchain.Public API changes
org.apache.maven.api.plugin.Mojowith@Inject Log/Session(org.apache.maven.api.di);requiresProject = falsebecomesprojectRequired = false;defaultPhaseis a string. Goal names and parameter names/properties unchanged.ToolchainManagerPrivatebecomessession.getService(ToolchainManager.class)(getToolchains,storeToolchainToBuildContext);ToolchainPrivatebecomesorg.apache.maven.api.Toolchain; toolchains XML goes throughToolchainsXmlFactory; models are the immutableorg.apache.maven.api.toolchaintypes withXmlNodeconfiguration.ToolchainsRequirement(public) keeps its getters; its package-private field is replaced byfromXmlNode(XmlNode).ToolchainConverterandToolchainsComponentConfigurator(Plexus converter plus custom configuratortoolchains-requirement-configurator) are deleted: thetoolchainsparameter is now anXmlNode, which rc-7's enhanced configurator populates directly (confirmed by thetoolchainITs).ToolchainDiscovereris an api.di@Named @Singletonwith a constructor takingToolchainsXmlFactory(was no-arg); it is public, so callers constructing it break.java -XshowSettingsfails is skipped (before, the NPE was caught and discovery returned an empty result).Gaps
ToolchainModelinto aToolchainfor an arbitrary model: thejdkToolchainFactoryis not bound in a plugin's injector (No binding ... @Named("jdk") ToolchainFactory).select-jdk-toolchaintherefore wraps discovered and current JDK models in a privateJdkToolchain(type, model,findTool);storeToolchainToBuildContextonly uses type and model, and core re-creates the real toolchain from the stored model.RequirementMatcherFactoryis compat-only. Matching is done locally onmodel.getProvides():versionthroughsession.parseVersionConstraint(..).contains(session.parseVersion(..)),envby the existing regex, everything else case-insensitive equals. The jdk factory's own matcher also does not knowenv, sotoolchain.matchesRequirementscould not have been reused.Xpp3Domreplaced byXmlNode(child("jdkHome").value()); the plugin no longer needsplexus-xml.<proc>is on; theMETA-INF/maven/org.apache.maven.api.di.Injectindex lists the four Mojo factories andToolchainDiscoverer.services.ToolchainFactorycontributed by an extension is found by the core manager only when it is registered through the Sisu index (javax.inject.@Named("custom")plussisu-maven-plugin:main-index), not throughMETA-INF/maven/org.apache.maven.api.di.Injectalone (Missing toolchain factory for type: customwith the api.di index). The IT fixturesetup-custom-toolchainis ported that way.User-visible changes
<prerequisites>followsmavenVersion4.0.0-rc-7).MojoExceptioninstead ofMojoFailureException(ITmissing-toolchainassertion updated).toolchainsparameter is logged at debug level as XML, notToolchainsRequirement{...}(ITselect-jdk-toolchain-rangenow asserts theRequired toolchain:info line instead).ToolchainFactorystill work through core's bridge; ones written for the v4 API need the Sisu index, see Gaps.Improvements: drops
maven-core,maven-plugin-api,maven-plugin-annotations,javax.inject,org.eclipse.sisu.plexus,plexus-xml,slf4j-api1.7 (now provided 2.0.x) andsisu-maven-plugin.Recommendation: merge-worthy as the 4.x line, with the jdk-factory and
envmatcher gaps filed against apache/maven: a way to create aToolchainfrom aToolchainModelwould remove the privateJdkToolchainwrapper.maven-changes-plugin: partial
Branch
agent/mvn4-api; PR not opened yet. Status: partial, 4.0.0-beta-1-SNAPSHOT, Java 17.Verified locally (Maven 4.0.0-rc-7, zulu-21, plugin-tools 4.0.0-beta-3, plugin-testing 4.0.0-beta-4):
mvn -B -ntp verify: 58 tests run, 0 failures, 0 errors, 1 skipped; BUILD SUCCESS.-Prun-its -DskipTests: 16 ITs, Passed 16, Failed 0, 1m40s.mvn -B -ntp verify -Prun-its: 54 tests run, 0 failures, 0 errors, 1 skipped; ITs Passed 16, Failed 0 (11 new, 5 kept); BUILD SUCCESS.spotless:check, RAT anddependency:analyzeran in the same build and pass.announce-mail-sender-parameter/verify.groovymakes that IT FAIL.What ported. Non-report goals
announcement-generate,announcement-mail,changes-check,changes-validateare v4 mojos (org.apache.maven.api.plugin.Mojo,@Inject Project/Session/Log,MojoException). The report goals (changes,jira-changes,github-changes,trac-changesas@Mojoreport names, plus the deprecatedchanges-report,jira-report,github-report,trac-report) are blocked: their sources stay in the tree and are excluded from compilation (maven-compiler-plugin<excludes>/<testExcludes>with a comment), because plugin-tools 4.0.0-beta-3 writes<requirements>from the@Componentfields ofAbstractMavenReportinto the 2.0.0 plugin.xml and rc-7 then rejects every goal of the plugin (proven for maven-pmd-plugin; not re-run here). The reporting chain (site plugin 3.x cast error, reporting-impl needing maven-core) is proven in the maven-changelog-plugin findings.Proved by real Maven 4 runs (ITs, invoker, through the existing
run-itsprofile)announcement-generatefrom changes.xml, with the five pre-existing ITs (plain, custom template pluschanges-validate, three failure cases for issue management) andannounce-generate-project-values, which prints every expression-derived value into a custom template and checks it.announcement-generatefrom JIRA (announce-generate-jira, wiremock): thejiraserver insrc/it/settings.xmlhas an encrypted password (master password fromsettings-security.xml). The mock only answers the search after the session login with the decryptedjira-password, soSession.getSettings()returns decrypted server passwords in a real build; theSettingsDecrypterinjection is not needed.announcement-mail(announce-mail,announce-mail-sender-parameter) against a fake SMTP server started insetup.groovy: the v4@Execute(goal = "announcement-generate")fork runs first and its output is the mail body; sender from<developers>byfromDeveloperId, from a<mailSender>bean parameter, cc list, subject default. The Geronimo transport opens one SMTP session per recipient (3 messages for 2 to + 1 cc), the old code did too.changes-check(valid, invalid date, relativexmlPath, relative invalid,skipSnapshots) andchanges-validate(failOnError true fails withchanges.xml file is not valid: ...: SAXException, false only warns).GitHubDownloaderhas a unit test with a mockedProject), the proxy path ofRestJiraDownloader,runOnlyAtExecutionRootunder a multi-module reactor,-T.Public API changes
AbstractChangesMojono longerextends AbstractMojobutimplements org.apache.maven.api.plugin.Mojo;projectisorg.apache.maven.api.Project(@Inject),getLog()is the v4Log; parametersbasedir(${basedir}) andmavenSessionremoved;isThisTheExecutionRoot()isproject.isTopProject().ChangesCheckMojo,ChangesValidatorMojo,AnnouncementMojo,AnnouncementMailMojo:@Mojoisorg.apache.maven.api.plugin.annotations.Mojo(threadSafedropped, no v4 attribute); constructor injection (ChangesValidatorMojo(ChangesSchemaValidator),AnnouncementMojo(VelocityComponent, SettingsDecrypter)) replaced by field@Inject(the generated v4 factory calls the no-arg constructor).AnnouncementMojo/AnnouncementMailMojo:MavenProject projectandSettings settingsparameters gone;AnnouncementMailMojo.getFrom/setFrom/getProject/setProjectremoved (developers come fromproject.getModel().getDevelopers()).ChangesXML,ReleaseUtils,IssueUtils,IssueManagementSystem,JqlQueryBuilder,JiraHelper,RestJiraDownloader,GitHubDownloader,TracDownloader,ProjectUtils:Logisorg.apache.maven.api.plugin.Log, exceptions areMojoException(wasMojoExecutionException/MojoFailureException),MavenProjectbecomesorg.apache.maven.api.Project,Settings/Server/Proxybecomeorg.apache.maven.api.settings.*.GitHubDownloader.configureAuthentication(SettingsDecrypter, String, Settings, Log)is now(String, Settings, Log);RestJiraDownloader.setSettingsDecrypterremoved.IssueAdapter.getReleases(List<Issue>)is nowgetReleases(List<Issue>, Session):org.apache.maven.artifact.versioning.ComparableVersionis not in the v4 API,Session.parseVersionreplaces it.ProjectJavamailMailSenderno longer extendsorg.codehaus.plexus.mailsender.AbstractMailSender(its baseAbstractLogEnabledneeds plexus-container-default/sisu-plexus, not available to a v4 plugin); it is a standalone class with the same setters andsend(MailMessage);initialize()and theConsoleLoggerwiring stay out of the mojo.javaVersion17;mavenVersion4.0.0-rc-7;<prerequisites><maven>is${mavenVersion}; plugin-tools 4.0.0-beta-3; plugin-testing 4.0.0-beta-4; slf4j-api 1.7.36 to 2.0.20.Gaps
<requirements>parse error plus the proven reporting chain). Not ported, not running. Affected:ChangesReport,JiraChangesReport,GitHubChangesReport,TracChangesReport, the three*DeprecatedReportaliases,AbstractChangesReport,ChangesReportRenderer,FeedGenerator(RSS/Atom, imports Doxia),AbstractIssuesReportRenderer,IssuesReportRenderer,IssuesReportHelper. They also useMavenProject.getCollectedProjects()(aggregate report) andMavenFileFilter(changes.xml interpolation), for which no route was checked.report-*) runclean siteand are not selected (<pomIncludes>in therun-itsprofile isannounce*andchanges-*).Settingsitself. A{...}value that fails to decrypt is used as given, whereSettingsDecrypterreportedSettingsProblems that the old code logged (log.error). That logging is gone.Projecthas no route to the Velocity/Plexus container:VelocityComponent(a Plexus component) is replaced by aVelocityEnginethe mojo builds with the same properties (classpath,fileloaders,IncludeRelativePath,space_gobbling=bc, read from theplexus-velocity2.4.0 bytecode). Reverse-engineered, will drift if plexus-velocity changes.${project.name}and${project.packaging.type}are left literal (use${project.model.name},${project.model.packaging});${project.description}and${project.url}were switched to${project.model.description}/${project.model.url}without testing the short form;${basedir}is not expanded (${project.basedir});@Parameter(property = "project.artifactId")no longer reads the project (defaults${project.artifactId}and${project.groupId}work).toAddresses/ccAddresses/bccAddresses(List<Object>) and themailSenderbean convert correctly in rc-7 (IT),Map<Object,Object> announceParameterstoo.projectin the Velocity context is noworg.apache.maven.api.model.Model(project.getModel()), notMavenProject:$project.name,$project.version,$project.propertiesstill resolve,$project.basedir,$project.build,$project.artifactdo not.MojoExceptionhas no failure/error split; output reads the same.Fileparameter (xmlPath=custom/my-changes.xml) resolves to the project's file (ITchanges-check-relative-xmlpath); the invoker runs from the project directory, so basedir versus working directory is not distinguished.javax.mail1.4 andactivationcome with the first, and SMTP sending works in the IT with them present. Whether they can go now was not tested.User-visible changes
changes,jira-changes,github-changes,trac-changes) and the deprecatedchanges-report,jira-report,github-report,trac-report.<reporting>entries for the plugin and the HTML/RSS output ofmvn siteare gone.$projectis the effective POMModel(see Gaps).announcement-generatedefault parameters now use${project.model.*}; unchanged names, properties and defaults otherwise (changes.version,changes.xmlPath,changes.announcementFile,changes.template,changes.templateDirectory,changes.jiraServerId,githubAPIServerId, ...).xmlPathdefault is${project.basedir}/src/changes/changes.xmlfor all four goals.announcement-mail:project.developersis no longer a (read-only) parameter;changes.sender,mailSender,fromDeveloperIdbehave as before.threadSafeflag not declared on the mojos.@Execute(goal = "announcement-generate")onannouncement-mailstill forks (v4 annotation, IT).Improvements
Recommendation
Land the four non-report goals as a v4 slice and leave the reports on the 3.x line (or a separate artifact) until maven-site-plugin, maven-reporting-impl and doxia-sitetools have v4 releases. Before merge: decide whether
$projectin custom templates should stay aModel, and file a settings-decrypt request in apache/maven so the un-decrypted-value case can be reported again.maven-project-info-reports-plugin: blocked
Branch
agent/mvn4-api; PR not opened yet. Status: blocked, no port attempted (all 16 goals are report goals), 4.0.0-beta-1-SNAPSHOT would be the version, Java 17. The worktree is unchanged beyond the CI commit; the experiments ran in scratch copies.Verified locally (Maven 4.0.0-rc-7, zulu-21), unported plugin on the
Build with Maven 4 onlycommit:mvn -B -ntp verifyβ 31 tests run, 0 failures, 0 errors, 0 skipped; BUILD SUCCESS.-Prun-its -DskipTestsβ 25 ITs, Passed 25, Failed 0, Skipped 0, 2m35s (26 directories undersrc/it, one is the shared settings file).Why there is nothing to port. The plugin has 16 goals and every one extends
AbstractProjectInfoReportβAbstractMavenReport, so there is no non-report goal to ship and the report block is proven elsewhere: maven-site-plugin 3.22.0 on rc-7 only accepts Maven 3 mojos as reports (Cannot cast ...ReportFactory to org.apache.maven.plugin.Mojo, maven-changelog-plugin and maven-reporting-impl findings), and a v4 report mojo in the same artifact as v3 ones makes plugin-tools 4.0.0-beta-3 write<requirements>into the 2.0.0 plugin.xml, which rc-7 rejects for every goal (maven-pmd-plugin). Neither was re-run here.Measured compile gap
A trial conversion: pom on maven-api-core/di/annotations/model/settings 4.0.0-rc-7, Java 17,
maven-reporting-impl5.0.0-SNAPSHOT (local v4 port),doxia-integration-tools3.0.0-SNAPSHOT, sources unchanged.mvn compileβ 610 distinct compile errors in 24 files (javac stops after symbol resolution, so type errors behind them are not yet counted): 156package ... does not exist, 447cannot find symbol. Packages that no longer exist, by number of import errors:org.apache.maven.project52,org.apache.maven.plugins.annotations27,org.apache.maven.model27,org.apache.maven.artifact13,org.apache.maven.plugin.logging8,org.apache.maven.artifact.versioning6,org.apache.maven.settings5,org.apache.maven.artifact.handler.manager4,org.apache.maven.artifact.resolver.filter3,org.apache.maven.artifact.handler3,org.apache.maven.execution2,org.apache.maven.artifact.repository2. Worst files: PluginsReport 67, DependenciesRenderer 57, PluginManagementReport 57, DependencyManagementRenderer 53, DependencyConvergenceReport 45, ModulesReport 38, TeamReport 36.One concrete error per blocked category:
maven-reporting-impl4.0.0 and only v4 dependencies:AbstractProjectInfoReport.java:[57,57] cannot access org.apache.maven.plugin.AbstractMojo/class file for org.apache.maven.plugin.AbstractMojo not foundMavenSession, site plugin cast error)IndexReport.java:[86,17] siteTool has private access in org.apache.maven.reporting.AbstractMavenReport, same inModulesReport:85;reactorProjectsis gone (used inAbstractProjectInfoReport,DependencyConvergenceReport,IndexReport,ModulesReport)getSiteTool()andgetReactorProjects()exist in the portMavenProject,ProjectBuilder,ProjectBuildingRequest,DefaultProjectBuildingRequest,MavenSession,MojoExecutionpackage org.apache.maven.project does not exist(52 imports);SummaryReport.java:[160,73] incompatible types: org.apache.maven.api.Project cannot be converted to org.apache.maven.project.MavenProjectProject,Session,ProjectBuilderservice exist; mechanical except the next rowprojectBuilder.build(pluginArtifact, buildRequest)(PluginsReport:237,PluginManagementReport:256, dependency licenses). Probe against rc-7:ProjectBuilderRequest.builder().session(s).artifact(a)βcannot find symbol: method artifact(Artifact); the builder has onlypath(Path)/source(Source)/repositories(...)ArtifactResolverand build from the path (dependency-plugin findings:Project.getParent()is empty for repository parents, so inherited license/url/organization of a plugin or dependency are lost)package org.apache.maven.model does not exist(27); used:Model,Developer,Contributor,License,Scm,IssueManagement,CiManagement,Notifier,MailingList,DistributionManagement,Site,Organization,Plugin,ReportPlugin,PluginManagement,Dependencyorg.apache.maven.api.model.*, immutable; read-only use here so mechanicalSettings,Proxy,Server(ProjectInfoReportUtils,LicensesReport)s.getSettings().getActiveProxy()βcannot find symbol: method getActiveProxy()session.getSettings().getProxies()filtered byisActive(); no decrypt service (see gpg/changes findings)Artifact,DefaultArtifact,ArtifactHandlerManager,VersionRange,ArtifactVersion,ArtifactFilter,ScopeArtifactFilter,StrictPatternIncludesArtifactFilter)package org.apache.maven.artifact.handler.manager does not exist;PluginsReportbuildsDefaultArtifactplusVersionRangefor each pluginTypeRegistry.require(type),Session.resolveVersionRange,Session.parseVersion*;maven-common-artifact-filters4.0.0-SNAPSHOT port usesPredicate<Dependency>DependenciesReport:197,DependencyConvergenceReport:854)buildDependencyGraph(ProjectBuildingRequest, ArtifactFilter)/collectDependencyGraph(buildingRequest, filter); themaven-dependency-tree4.0.0-SNAPSHOT port only has(Session, Project, Predicate<Dependency>)getParent()is kept by the port; the convergence report lists versions that conflict, and conflict winner and omitted-version data exist only insideNode.asString()per the dependency-tree findings, soDependencyConvergenceReporthas no structured route (not run)DependenciesReportinjectsJarClassesAnalysis)javax.injectcomponent; the shared-jar port moved toorg.apache.maven.api.di, so under Maven 3 it is not found, and under v4 the hand-kept DI index appliesI18N,SiteTool,ScmManager,ArtifactHandlerManager,RepositorySystem)AbstractProjectInfoReport(RepositorySystem, I18N, ProjectBuilder); v4 DI givesNo binding to construct an instance for key ScmManager/SiteTool(changelog and reporting-impl findings)Lookup.lookup(...)for ScmManager (scm-publish port needed a hand-builtScmManagerFactory);I18Ncan be replaced byResourceBundle;RepositorySystemhas no plugin-visible route (dependency-tree findings)@Mojo(requiresDependencyResolution = TEST)package org.apache.maven.plugins.annotations does not exist(27)@MojohasdependencyResolutionPathScopes; plugin-tools writes no<resolutions>, soDependencyResolvermust be injectedmaven-archiverBuildHelper(SummaryReport:160-169)MavenProject(error above)Per report: Maven 3 API needed beyond the base class, and v4 route
issue-management,ci-management,mailing-lists,distribution-managementIssueManagement,CiManagement,Notifier,MailingList,DistributionManagement),LogProject.getModel()dependency-infoteamDeveloper,Contributor,MavenProjectlicensesLicense,Settingsproxy/server throughProjectInfoReportUtilsfor URL checksSession.getSettings()getActiveProxy)summaryBuildHelper,Organization,PluginindexSiteTool,ArtifactRepository,ProjectBuildingRequestSession,Project)SiteToolbeing a Sisu component: no DI bindingmodulesSiteTool,ProjectBuilderper module,DistributionManagement/SiteProjectBuilder.build(Session, Path)plus sitetoolsSiteToollikeindex; per-module build fromProject.getBasedir()should workscmScmManager, Git/Hg/Svn provider repository classes (maven-scm 2.2.1),ScmLookupor a hand-built manager, as in the scm-publish portdependenciesDependencyGraphBuilder,JarClassesAnalysis,RepositorySystemartifact resolution (RepositoryUtils),ProjectBuilderfor dependency POMs,ArtifacteverywhereArtifactResolver, POM build from resolved fileDependenciesRenderer(1351 lines),DependencyManagementRenderer(373) andDependencies(294) useArtifact/MavenProject; parent-inherited licenses are lostdependency-managementArtifactHandlerManager,RepositorySystemVersionRangeRequest,ProjectBuilderfor licensesTypeRegistry,Session.resolveVersionRange, POM builddependency-convergence(aggregator)DependencyCollectorBuilderverbose graph, graph filters and visitors, reactor projectssession.getProjects()plugins,plugin-managementProjectBuilder.build(Artifact, ...)for each plugin,ArtifactHandlerManager,VersionRange,DefaultArtifact,ReportPluginPublic API changes
None made. A port would drop
maven-core/maven-artifact/maven-model/maven-plugin-api/maven-settings/maven-resolver-apiand Sisu, change every report constructor (RepositorySystem,I18N,ProjectBuilderinjection), and stop accepting${project}/${session}as parameters.Gaps
Project.getParent()of such a project, for conflict data onapi.Node, for a plugin-visibleRepositorySystem, for Sisu components (SiteTool,ScmManager,I18N).org.apache.maven.api.di.Injectindex is enough forJarClassesAnalysisin this plugin.full-pom,multi-module, ...) are the only real coverage of the rendered output; none can run against a v4 report until the site plugin accepts one.User-visible changes
Not applicable: no change made. A port would require Maven 4.0.0-rc-7+, Java 17, and produce no report until maven-site-plugin, maven-reporting-impl and doxia-sitetools have v4 releases.
Improvements
None claimed. Dependencies a port would drop are listed above; measured effect none.
Recommendation
Keep the plugin on 3.x; it runs unchanged under Maven 4 (31 tests, 25 of 25 ITs pass). Revisit after the chain doxia-sitetools β maven-site-plugin β reporting-impl lands. When it does, port in three steps: (1) the eleven model-only or light reports (
issue-management,ci-management,mailing-lists,distribution-management,dependency-info,team,licenses,summary,index,modules,scmafter a maven-scm decision), (2)dependenciesanddependency-managementonce a repository-artifact project builder (or anapiroute for parent-inherited POM data) exists, (3)dependency-convergenceandplugins/plugin-managementlast. Upstream asks that this measurement supports:ProjectBuilderRequest.artifact(...), structured conflict data onapi.Node, a non-Sisu way to getSiteToolandI18N.slachiewicz commentedon Sep 30, 2026