DavidTavoularis commented on PR #11768:
URL: https://github.com/apache/maven/pull/11768#issuecomment-4109377817

   All 4 review items addressed. Here's a summary of the changes:
     1. Scoped derive() repository override to BUILD_CONSUMER only 
(DefaultModelBuilder.java:351): Added request.getRequestType() == 
BUILD_CONSUMER check so the repository override doesn't affect parent POM 
resolution or other derived sessions.
     2. Removed repositoryFactory caching field (DefaultModelBuilder.java): 
Deleted the mutable repositoryFactory field and getRepositoryFactory() method. 
Now calls session.getService(RepositoryFactory.class) directly at both call 
sites.
     3. Added explicit handling for non-InternalMavenSession 
(DefaultConsumerPomBuilder.java:337-342): Added an else branch with a 
LOGGER.debug() message explaining that settings.xml profiles won't be passed in 
embedded/testing contexts.
     4. Replaced reflection-based test with package-private accessor test 
(DefaultModelBuilderTest.java): Rewrote 
testDeriveSessionUsesRequestRepositories → 
testBuildConsumerWithExplicitRepositories. Added getRepositories() and 
getExternalRepositories() accessors to ModelBuilderSessionState. The test now 
uses package-private access to mainSession and these accessors to directly 
assert both repositories and externalRepositories contain the custom repo — no 
reflection needed.
   


-- 
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