Repository navigation
Open
Labels
enhancementNew feature or requestNew feature or requestmvn4trackingTracking issue with sub-issuesTracking issue with sub-issues
Description
New feature, improvement proposal
These gaps came up when Maven plugins were ported from the Maven 3 API to the Maven 4 API (see #13302). Each was checked on maven-4.0.x and master on 2026-11-14, and none has an open issue. This is a list to triage, not a request to implement all of it: each item can be picked up on its own or rejected. The design trackers for the surrounding work are #13460 and #13499.
Type and method names below use the maven-4.0.x spelling; master has noun-style accessors for the same members (url() for getUrl(), and so on).
Repositories and resolution
- Metadata resolution, repository policies and artifact descriptors. Replaces the resolver calls
RepositorySystem.resolveMetadataandreadArtifactDescriptor, and the policies of the Maven 3ArtifactRepository.RemoteRepositoryhas onlygetId(),getUrl()andgetProtocol(), so a plugin cannot read the release or snapshot policy of a repository it was handed. There is no service that resolvesmaven-metadata.xmlwith update and checksum policy (masterhas a read-onlyRepositoryMetadatatype used by repository events) and none that returns an artifact descriptor, so relocation is re-implemented. Belongs inorg.apache.maven.api.servicesandRemoteRepository. Hit in maven-archetype-plugin, maven-resolver-ant-tasks, maven-dependency-plugin, maven-doap-plugin. Related: v4 SPI: Repository event listener for artifact/metadata changes #13520 (repository events), Enhance relocation to work for all versions #11255 (relocation behavior). - Existence check and remote layout on
Transport. ReplacesWagon.resourceExistsandArtifactRepository.pathOf(Artifact).Transporthasget,getBytes,getStringandput*, no way to ask whether a resource exists without downloading it.Session.getPathForRemoteArtifactreturns the path in the local cache, not the location in the remote repository, so a plugin buildsg/a/v/a-v.extby hand. Needed by maven-doap-plugin, which now infers existence from a.sha1file. Related: [MRESOLVER-555] Existence check should lax the repository update policy maven-resolver#1224 (update policy of the resolver's own existence check). -
Session.withLocalRepositorycannot change resolver configuration. Replaces cloning theRepositorySystemSessionwithaether.enhancedLocalRepository.split=false.withLocalRepository(LocalRepository)takes a path and copies the configuration of the outer session (AbstractSessioninmaven-impl), so a plugin installing into a staging repository gets the split layout of the invoking build. There is also no helper that merges twoSettingsobjects, the role of the Maven 3SettingsUtils.merge. Needed by maven-invoker-plugin (MINVOKER-377). Related: [MNG-8167] enable "split repo" in settings.xml #10601 (split repository switch insettings.xml). -
Artifact,ArtifactCoordinatesandDependencyCoordinatesfactories need aSession. Every method ofArtifactFactory,ArtifactCoordinatesFactoryandDependencyCoordinatesFactorytakes one, so helper code and unit tests cannot create coordinates without a full session.VersionParserandTypeRegistryalready work without one. Needed by maven-dependency-tree, maven-mapping and maven-surefire-common. - A dependency selector for one resolution. Replaces setting an Aether
DependencySelectoron a copy of theRepositorySystemSession.DependencyResolverRequesttakes aPathScopeand nothing else that shapes the graph. The compile and test path scopes run in the resolver'sELIMINATEmode, where conflict resolution runs over the whole graph before the unwanted scopes are filtered out. That is Maven's class path semantics; a plugin that needs each class path mediated on its own cannot ask for it. Needed by maven-dependency-plugin, which picks the version a given class path would see (MDEP-726). Related: Test the depth semantics of the impl scope and optional selectors maven-resolver#2288 (tests of the scope selectors).
Project and model
- Original (pre-interpolation) model on
Project. ReplacesMavenProject.getOriginalModel().ProjecthasgetModel()only; plugins re-read the POM file withModelXmlFactory, which returns the file as modified so far instead of the load-time state.ModelBuilderResult.getRawModel()exists on the builder service but is not reachable from aProject. Hit in maven-release-plugin (nine uses) and maven-enforcer-plugin. - Changing the includes or excludes of a project source root. Replaces Maven 3
Resource.addExcludeonMavenProject.getResources().SourceRootexposesincludes()andexcludes()read-only, andProjectManagercan add a source root but not remove or replace one. A plugin that takes a file from a resource directory, processes it and writes the result cannot keep the resources plugin from copying the original as well. Needed by maven-remote-resources-plugin, which does this for project files that override a bundle resource (MRRESOURCES-10). - Strict reading rejects two elements of model version 4.0.0.
<reports>under<project>and<goals>under<plugin>are deprecated fields thatmaven.mdokeeps for model version 4.0.0 only (MNG-7602), and the Maven 3 strict reader accepts them.reader-stax.vmgenerates the reader from the fields of the current model version, soMavenStaxReaderin strict mode fails on both, on 4.0.0-rc-7 and onmaster. A plugin that reads Maven 3 POM fragments strictly, to fail on an unknown element, has to read leniently instead. Hit in maven-remote-resources-plugin (supplemental models).
Mojo configuration and toolchains
-
${plugin.*}expressions. Replaces${plugin},${plugin.artifactMap}and${project.artifactMap}of the Maven 3PluginParameterExpressionEvaluator.PluginParameterExpressionEvaluatorV4resolves objects undersession.,project.,mojo.andsettings.only, on both branches. Hit in maven-surefire-plugin, maven-scm-publish-plugin, maven-changelog-plugin. Related: Add a classifier-aware artifact map (fix #6773)Â #13672 (merged; an artifact map on the Maven 3MavenProject, not the evaluator). -
ToolchainFactoryis not injectable. ReplacesToolchainFactory.createToolchain(ToolchainModel)from Maven 3maven-core. The Maven 4 interface inorg.apache.maven.api.servicesdoes not extendService, andDefaultToolchainManagerreceives the factories as aMap<String, ToolchainFactory>, so a plugin cannot get thejdkfactory to turn aToolchainModelinto aToolchain. Needed by maven-toolchains-plugin. Related: [MNG-8576] Investigate modifying the Toolchain API to be session/project scoped #10657 (scope ofToolchainManager). - Whether a mojo execution was requested on the command line. Replaces Maven 3
MojoExecution.getSource(). Onmaven-4.0.xthere is no source, andgetLifecyclePhase()returningnullfor a command line goal is not documented. Onmasterthe Javadoc ofmodel(),executionId()andlifecyclePhase()says each is empty for a direct CLI invocation, butDefaultMojoExecutionpasses the Maven 3 execution id through, which isdefault-clior the@idgiven on the command line, soexecutionId()is not empty;lifecyclePhase()is also empty for a goal forked by@Execute(goal = ...). Needed by maven-dependency-plugin (requireExplicitDependencies), which compares the execution id withdefault-cliinstead.
Session and settings
- Settings decryption. Replaces
SettingsDecrypter.decryptandSecDispatcher.decrypt. Nomaven-api-*module exposes a decrypt service;maven-impldecrypts insideDefaultSettingsBuilder. Plugins that need to decrypt a value of their own, such as a key store password or a passphrase looked up by server id, rebuild the dispatcher from internal classes of plexus-sec-dispatcher. Needed by maven-release-plugin, maven-gpg-plugin, maven-jarsigner-plugin. Related: [MNG-5356] Make encrypt/decrypt logic pluggable #6919 (pluggable crypto), [MNG-5438] cli parameter to use a custom path settings-security.xml #6494 (path ofsettings-security.xml). - Command line options that forked builds need. Replaces
MavenExecutionRequest(isShowErrors(), user and global settings and toolchains files).BuildInvocationexists onmasteronly; it carries goals, profiles, projects, failure behavior and offline, but not-eand not the files given with-s,-gs,-tand-gt. They are parsed intoOptionsinmaven-api-cli, and nothing hands them to a mojo throughSession. Needed by maven-surefire-plugin (-efor the forked JVM), maven-javadoc-plugin (nested Maven runs).
Not included
These gaps already have an issue, so they are not repeated above:
- a configured mojo instance without execution: v4 API: Mojo configuration introspection without execution #13518
- dependency resolution metadata on
Node: Node API: expose dependency resolution metadata (winner, pre-managed version/scope, original scope) #13151 - module path dispatch for modular dependencies: [MNG-7855] Dependencies wrongly put on class-path rather than module-path #9065
- consumer POM file on the project: [MNG-8072] Add a consumerPomFile to the MavenProject #10863
- Sisu components in Maven 4 mojos: 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
- process execution service: Process execution service for the Maven 4 APIÂ #13895
MojoExecutionaccessors that differ between 4.0.x and 4.2: MojoExecution accessors differ between maven-4.0.x and master, so a plugin built for 4.0 fails on 4.2 with NoSuchMethodError #14000
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestmvn4trackingTracking issue with sub-issuesTracking issue with sub-issues
Activity