diff --git a/daemon-m39/src/main/java/org/apache/maven/project/SnapshotModelCacheFactory.java b/daemon-m39/src/main/java/org/apache/maven/project/SnapshotModelCacheFactory.java index a070c7c57..089462570 100644 --- a/daemon-m39/src/main/java/org/apache/maven/project/SnapshotModelCacheFactory.java +++ b/daemon-m39/src/main/java/org/apache/maven/project/SnapshotModelCacheFactory.java @@ -25,6 +25,7 @@ import org.apache.maven.model.building.ModelCache; import org.apache.maven.repository.internal.DefaultModelCacheFactory; import org.apache.maven.repository.internal.ModelCacheFactory; +import org.eclipse.aether.DefaultRepositoryCache; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.sisu.Priority; @@ -40,7 +41,9 @@ public class SnapshotModelCacheFactory implements ModelCacheFactory { @Inject public SnapshotModelCacheFactory(DefaultModelCacheFactory factory) { this.factory = factory; - this.globalCache = factory.createCache(new DefaultRepositorySystemSession()); + DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); + session.setCache(new DefaultRepositoryCache()); + this.globalCache = factory.createCache(session); } @Override