Skip to content

Incremental build api - #1118

Closed
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:build-context
Closed

Incremental build api#1118
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:build-context

Conversation

@gnodet

@gnodet gnodet commented May 23, 2023

Copy link
Copy Markdown
Contributor

@cstamas

cstamas commented Aug 3, 2023

Copy link
Copy Markdown
Member

This is a must have thing...

gnodet added a commit that referenced this pull request Jul 28, 2026
Avoid package collision with the incremental build context API (PR #1118)
which uses org.apache.maven.api.build for BuildContext, Input, Output,
etc. Moving the report types to a sub-package keeps both features cleanly
separated under the shared org.apache.maven.api.build namespace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


Port the incremental build context from PR apache#1118 to Maven 4 conventions:
- API in org.apache.maven.api.build.context (avoids collision with build report API)
- Core impl in maven-impl using Maven 4 DI (org.apache.maven.api.di)
- Maven integration (MavenBuildContext, ProjectWorkspace, digest) stays in maven-core
- Replace plexus-utils dependencies (MatchPatterns, CachingOutputStream) with pure Java
- Add Maven 4 annotations (@experimental, @nonnull, @nullable, @SInCE 4.0.0)
- All 41 tests passing in maven-impl

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet

gnodet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #12576, which ports this incremental build context API to Maven 4 architecture:

  • API relocated to org.apache.maven.api.build.context with full Maven 4 annotations (@Experimental, @Nonnull/@Nullable, @since 4.1.0)
  • Implementation moved from maven-core to maven-impl, using Maven 4 DI (org.apache.maven.api.di) instead of javax.inject
  • Plexus-utils dependencies replaced with pure Java (regex-based pattern matching, BufferedOutputStream)
  • Comprehensive Javadoc with use cases, code examples, and package docs
  • Bug fixes in ClasspathDigester and defensive coding improvements
  • 41 tests passing

Thank you @gnodet for the original design — the Workspace abstraction, Metadata/Resource type hierarchy, and InputSet aggregation pattern are excellent foundations.

@gnodet

gnodet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #12576 which modernizes this for Maven 4.

@gnodet gnodet closed this Jul 28, 2026
gnodet added a commit that referenced this pull request Aug 4, 2026
Port and modernize the incremental build context from PR #1118,
building on the original Sonatype plexus-build-api / Takari
incrementalbuild work.

API (maven-api-core):
- BuildContext: register inputs, check status, associate
  outputs, skip execution, automatic stale output cleanup
- SPI: Workspace (NORMAL/ESCALATED/SUPPRESSED),
  CommittableBuildContext, BuildContextEnvironment,
  BuildContextFinalizer
- Diagnostic messages are NOT part of this API — use
  DiagnosticReporter from the build report API instead

Implementation (maven-impl):
- DefaultBuildContext with timestamp/size change detection
- State serialization for cross-build persistence
- PathMatcherFactory integration for Ant-style patterns
- 36 tests

Maven integration (maven-core):
- MojoExecutionScoped DI wiring
- ClasspathDigester + MojoConfigurationDigester for automatic
  configuration change detection
- MavenBuildContextFinalizer for post-mojo commit
- maven.buildcontext.skip property to disable entirely
- Performance: released-artifact digest bypass, no-op state skip,
  single-syscall file status, field reflection cache

Based on #12572 (Build Report Foundation).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants