Skip to content

Deprecate old project builder API in favor of new API - #10990

Merged
gnodet merged 1 commit into
apache:masterfrom
gnodet:deprecate-project-builder-api
Jul 23, 2025
Merged

gnodet merged 1 commit into
apache:masterfrom
gnodet:deprecate-project-builder-api

Conversation

@gnodet

@gnodet gnodet commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

Description

Deprecates the old project builder API in favor of the new org.apache.maven.api.services.ProjectBuilder API, following the same pattern used for the model builder API deprecation.

Background

This addresses the issue mentioned in #10984 where ProjectBuildingResult exposes ModelProblem from the deprecated model builder API, creating an inconsistency since ModelProblem is deprecated but ProjectBuildingResult was not.

Changes Made

  • Added @Deprecated(since = "4.0.0") annotations to all project builder related classes and interfaces
  • Added deprecation messages pointing users to org.apache.maven.api.services.ProjectBuilder
  • Follows the exact same deprecation pattern used for the model builder API

Deprecated Classes:

Core Project Builder API:

  • ProjectBuilder - Main interface
  • ProjectBuildingRequest - Request interface
  • ProjectBuildingResult - Result interface
  • ProjectBuildingException - Exception class

Default Implementations:

  • DefaultProjectBuilder - Default implementation
  • DefaultProjectBuildingRequest - Default request implementation
  • DefaultProjectBuildingResult - Default result implementation

Dependency Resolution API:

  • DependencyResolutionRequest - Request interface
  • DependencyResolutionResult - Result interface
  • DependencyResolutionException - Exception class
  • ProjectDependenciesResolver - Resolver interface
  • DefaultDependencyResolutionRequest - Default request implementation
  • DefaultDependencyResolutionResult - Default result implementation
  • DefaultProjectDependenciesResolver - Default resolver implementation

Testing

  • ✅ Full build passes with Maven 4.0.0-rc-4 and JDK 21
  • ✅ All compilation and tests continue to work
  • ✅ Deprecation warnings are properly displayed when using the old API
  • ✅ No breaking changes - purely additive deprecation annotations

Migration Path

All deprecated classes now clearly point developers to use org.apache.maven.api.services.ProjectBuilder instead, providing a clear migration path to the new API.

Consistency Achieved

This resolves the inconsistency where ProjectBuildingResult was exposing the deprecated ModelProblem class but wasn't itself deprecated. Now there's complete consistency between the deprecation status of the old model builder API and the old project builder API.

Fixes #10984


Pull Request opened by Augment Code with guidance from the PR author

- Add @deprecated(since = \4.0.0\) annotations to all project builder related classes
- Add deprecation messages pointing to org.apache.maven.api.services.ProjectBuilder
- Follows same pattern used for model builder API deprecation
- Resolves inconsistency where ProjectBuildingResult exposed deprecated ModelProblem

Deprecated classes:
- ProjectBuilder and DefaultProjectBuilder
- ProjectBuildingRequest and DefaultProjectBuildingRequest
- ProjectBuildingResult and DefaultProjectBuildingResult
- ProjectBuildingException
- DependencyResolutionRequest and DefaultDependencyResolutionRequest
- DependencyResolutionResult and DefaultDependencyResolutionResult
- DependencyResolutionException
- ProjectDependenciesResolver and DefaultProjectDependenciesResolver

Fixes apache#10984
@elharo elharo added the deprecated Pull requests that deprecate features label Jul 23, 2025
@gnodet
gnodet merged commit 8ce8cd0 into apache:master Jul 23, 2025
@github-actions github-actions Bot added this to the 4.1.0 milestone Jul 23, 2025
gnodet added a commit to gnodet/maven that referenced this pull request Jul 24, 2025
- Add @deprecated(since = \4.0.0\) annotations to all project builder related classes
- Add deprecation messages pointing to org.apache.maven.api.services.ProjectBuilder
- Follows same pattern used for model builder API deprecation
- Resolves inconsistency where ProjectBuildingResult exposed deprecated ModelProblem

Deprecated classes:
- ProjectBuilder and DefaultProjectBuilder
- ProjectBuildingRequest and DefaultProjectBuildingRequest
- ProjectBuildingResult and DefaultProjectBuildingResult
- ProjectBuildingException
- DependencyResolutionRequest and DefaultDependencyResolutionRequest
- DependencyResolutionResult and DefaultDependencyResolutionResult
- DependencyResolutionException
- ProjectDependenciesResolver and DefaultProjectDependenciesResolver

Fixes apache#10984
@gnodet
gnodet deleted the deprecate-project-builder-api branch September 2, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated Pull requests that deprecate features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants