Experiment: migrate to Maven 4 BuildContext API - #496
Draft
gnodet wants to merge 4 commits into
Draft
Conversation
…cessing Inject the new Maven 4 BuildContext (org.apache.maven.api.build.context) into ResourcesMojo and use it for incremental change detection: - Register all resource files as inputs via buildContext.registerInputs() - Check Metadata<Input>.getStatus() for NEW/MODIFIED status - Skip resource processing entirely when no changes detected - Call buildContext.markSkipExecution() to carry over state Also update to maven-filtering 4.0.0-beta-2-SNAPSHOT which has been migrated to use the new BuildContext API directly, removing the need for the old plexus-build-api dependency. Depends on: apache/maven#12576 (BuildContext API in maven-api-core) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…iltering Remove registerResourceInputs() from the mojo — BuildContext interaction now lives entirely in maven-filtering's DefaultMavenResourcesFiltering. This eliminates double-registration and keeps a single registration point for all plugins that use maven-filtering. The mojo now only: - Resolves resource roots - Calls doExecute() which delegates to maven-filtering - Uses markSkipExecution() for explicit skip scenarios Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Provide BuildContext and PathMatcherFactory via @provides @priority(10) methods in each test class so the test DI container can resolve DefaultMavenResourcesFiltering without requiring the MojoExecutionScoped infrastructure from the full Maven runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete the empty Providers.java (was the old plexus BuildContext provider, now unused) and remove the stale comment from pom.xml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Experimental branch migrating maven-resources-plugin to use the new Maven 4
BuildContextAPI (from apache/maven#12576) via the updated maven-filtering library (apache/maven-filtering#363).BuildContextintoResourcesMojoto support incremental resource processingBuildContext-aware processing, removing duplicated include/exclude logicmarkSkipExecution()when execution is skipped (e.g.,skip=true)BuildContextandPathMatcherFactoryvia@Provides @Priority(10)in each test class to avoidMojoExecutionScopedresolution failureDepends on
Test plan
🤖 Generated with Claude Code