mirror of
https://github.com/apache/maven-mvnd.git
synced 2026-01-13 07:04:14 +08:00
Fix missing @Inject, make sure the InvalidatingXxxCache are prioritized
This commit is contained in:
@@ -27,11 +27,13 @@ import org.apache.maven.project.ExtensionDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
|
||||
import org.eclipse.sisu.Priority;
|
||||
import org.mvndaemon.mvnd.cache.Cache;
|
||||
import org.mvndaemon.mvnd.cache.CacheFactory;
|
||||
|
||||
@Singleton
|
||||
@Named
|
||||
@Priority(10)
|
||||
public class InvalidatingExtensionRealmCache extends DefaultExtensionRealmCache {
|
||||
|
||||
protected static class Record implements org.mvndaemon.mvnd.cache.CacheRecord {
|
||||
|
||||
@@ -18,16 +18,19 @@ package org.mvndaemon.mvnd.cache.invalidating;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugin.DefaultPluginArtifactsCache;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.eclipse.sisu.Priority;
|
||||
import org.mvndaemon.mvnd.cache.Cache;
|
||||
import org.mvndaemon.mvnd.cache.CacheFactory;
|
||||
|
||||
@Singleton
|
||||
@Named
|
||||
@Priority(10)
|
||||
public class InvalidatingPluginArtifactsCache extends DefaultPluginArtifactsCache {
|
||||
|
||||
protected static class Record implements org.mvndaemon.mvnd.cache.CacheRecord {
|
||||
@@ -50,6 +53,7 @@ public class InvalidatingPluginArtifactsCache extends DefaultPluginArtifactsCach
|
||||
|
||||
final Cache<Key, Record> cache;
|
||||
|
||||
@Inject
|
||||
public InvalidatingPluginArtifactsCache(CacheFactory cacheFactory) {
|
||||
this.cache = cacheFactory.newCache();
|
||||
}
|
||||
|
||||
@@ -33,12 +33,14 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.sisu.Priority;
|
||||
import org.mvndaemon.mvnd.cache.Cache;
|
||||
import org.mvndaemon.mvnd.cache.CacheFactory;
|
||||
import org.mvndaemon.mvnd.cache.CacheRecord;
|
||||
|
||||
@Singleton
|
||||
@Named
|
||||
@Priority(10)
|
||||
public class InvalidatingPluginDescriptorCache extends DefaultPluginDescriptorCache {
|
||||
|
||||
@FunctionalInterface
|
||||
|
||||
@@ -24,20 +24,17 @@ import javax.inject.Singleton;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugin.DefaultPluginRealmCache;
|
||||
import org.apache.maven.plugin.PluginContainerException;
|
||||
import org.apache.maven.plugin.PluginRealmCache;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
|
||||
import org.eclipse.sisu.Priority;
|
||||
import org.eclipse.sisu.Typed;
|
||||
import org.mvndaemon.mvnd.cache.Cache;
|
||||
import org.mvndaemon.mvnd.cache.CacheFactory;
|
||||
|
||||
@Singleton
|
||||
@Named
|
||||
@Priority(10)
|
||||
@Typed(PluginRealmCache.class)
|
||||
public class InvalidatingPluginRealmCache extends DefaultPluginRealmCache {
|
||||
|
||||
@FunctionalInterface
|
||||
|
||||
@@ -27,11 +27,13 @@ import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.lifecycle.LifecycleExecutionException;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.artifact.DefaultProjectArtifactsCache;
|
||||
import org.eclipse.sisu.Priority;
|
||||
import org.mvndaemon.mvnd.cache.Cache;
|
||||
import org.mvndaemon.mvnd.cache.CacheFactory;
|
||||
|
||||
@Singleton
|
||||
@Named
|
||||
@Priority(10)
|
||||
public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCache {
|
||||
|
||||
static class Record implements org.mvndaemon.mvnd.cache.CacheRecord {
|
||||
|
||||
Reference in New Issue
Block a user