From f52808dcd2532ce6833dd162ff6c96f3d316bf95 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 7 Mar 2023 19:56:16 +0100 Subject: [PATCH] Fix cache factory for mvn 3.9.x --- .../org/apache/maven/project/SnapshotModelCacheFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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