Skip to content

Commit

Permalink
Fix cache factory for mvn 3.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 7, 2023
1 parent f5db0ab commit f52808d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit f52808d

Please sign in to comment.