You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "cstamas (via GitHub)" <gi...@apache.org> on 2023/02/23 08:44:44 UTC

[GitHub] [maven] cstamas commented on a diff in pull request #1008: [MNG-7693] For older clients make OOTB defaults

cstamas commented on code in PR #1008:
URL: https://github.com/apache/maven/pull/1008#discussion_r1115375813


##########
maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java:
##########
@@ -999,6 +1000,9 @@ class InternalConfig {
     }
 
     private ModelCache createModelCache(RepositorySystemSession session) {
-        return modelCacheFactory.createCache(session);
+        // MNG-7693: for older clients (not injecting ModelCacheFactory), make this work OOTB w/ defaults
+        return modelCacheFactory != null
+                ? modelCacheFactory.createCache(session)
+                : new DefaultModelCacheFactory().createCache(session);

Review Comment:
   We can investigate this, yes, but for this PR I'd really not change any semantics here, just fix the NPE for older clients. ie. restore backward compatibility.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org