mickaelistria commented on a change in pull request #194: MNG-6350 - Test +
System property to disable global model cache
URL: https://github.com/apache/maven/pull/194#discussion_r238852589
##########
File path:
maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
##########
@@ -355,7 +365,8 @@ private ModelSource createStubModelSource( Artifact
artifact )
ReactorModelPool modelPool = new ReactorModelPool();
- InternalConfig config = new InternalConfig( request, modelPool );
+ InternalConfig config = new InternalConfig( request, modelPool,
+ useGlobalModelCache() ? getModelCache() : new
ReactorModelCache() );
Review comment:
I'm basically restoring the behavior before changes for MNG-6311 were
applied.
I think in case of reading a single project, we don't need a cache as there
is no risk that we will read the same pom multiple times; but in the case of
using `build(listOfProject,...)`, then the cache is necessary to make sure that
poms are read only once (so that 2 children module of the same parent would
reference the same parent as MavenProject and not instantiate 2 clones of it).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services