slachiewicz opened a new pull request, #206:
URL: https://github.com/apache/maven-dist-tool/pull/206

   `MavenProjectBuilder` is the Maven 2 interface and lives only in 
`maven-compat`. `ProjectBuilder` in maven-core does the same job, and there was 
exactly one call site.
   
   ```java
   - MavenProject artifactProject =
   -         mavenProjectBuilder.buildFromRepository(artifact, 
artifactRepositories, localRepository, false);
   + ProjectBuildingRequest request = new 
DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
   + request.setRemoteRepositories(artifactRepositories);
   + request.setLocalRepository(localRepository);
   + request.setProcessPlugins(false);
   + MavenProject artifactProject =
   +         projectBuilder.build(artifact, false, request).getProject();
   ```
   
   Three notes on faithfulness:
   
   - The trailing `false` is `allowStubModel`, and `ProjectBuilder` has a 
`build(Artifact, boolean, ProjectBuildingRequest)` overload that takes it, so 
that behaviour is unchanged rather than approximated.
   - The request derives from `session.getProjectBuildingRequest()`, so it 
inherits the repository session, offline mode and the rest instead of starting 
from a bare one.
   - `setProcessPlugins(false)` keeps the old behaviour — these reads never 
processed plugins.
   
   The `session` parameter is new; the mojo had no reason to hold one before.
   
   **`ArtifactFactory` stays.** Despite the name it lives in maven-core, not 
maven-compat, so it is not part of this.
   
   **Verified:** `mvn verify` clean before and after.
   
   Part of a survey of which projects still declare `maven-compat` versus which 
genuinely need it. Related, if you want the context: apache/maven#12709 covers 
the baseline question that blocks several of the others.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to