Package org.apache.maven.buildcache.xml
Class CacheConfigImpl
- java.lang.Object
-
- org.apache.maven.buildcache.xml.CacheConfigImpl
-
- All Implemented Interfaces:
CacheConfig
@Named public class CacheConfigImpl extends Object implements CacheConfig
CacheConfigImpl
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALWAYS_RUN_PLUGINS
static String
BASELINE_BUILD_URL_PROPERTY_NAME
static String
CACHE_ENABLED_PROPERTY_NAME
static String
CACHE_LOCATION_PROPERTY_NAME
static String
CACHE_SKIP
Flag to control if we should skip lookup for cached artifacts globally or for a particular project even if qualifying artifacts exist in build cache.static String
CONFIG_PATH_PROPERTY_NAME
static String
FAIL_FAST_PROPERTY_NAME
static String
LAZY_RESTORE_PROPERTY_NAME
static String
MANDATORY_CLEAN
static String
REMOTE_ENABLED_PROPERTY_NAME
static String
REMOTE_SERVER_ID_PROPERTY_NAME
static String
REMOTE_URL_PROPERTY_NAME
static String
RESTORE_GENERATED_SOURCES_PROPERTY_NAME
static String
RESTORE_ON_DISK_ARTIFACTS_PROPERTY_NAME
static String
SAVE_NON_OVERRIDEABLE_NAME
static String
SAVE_TO_REMOTE_PROPERTY_NAME
static String
SKIP_SAVE
Flag to disable cache saving
-
Constructor Summary
Constructors Constructor Description CacheConfigImpl(XmlService xmlService, org.apache.maven.execution.MavenSession session, org.apache.maven.rtinfo.RuntimeInformation rtInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
adjustMetaInfVersion()
boolean
calculateProjectVersionChecksum()
boolean
canIgnore(org.apache.maven.plugin.MojoExecution mojoExecution)
String
getAlwaysRunPlugins()
List<DirName>
getAttachedOutputs()
String
getBaselineCacheUrl()
String
getDefaultGlob()
List<String>
getEffectivePomExcludeProperties(org.apache.maven.model.Plugin plugin)
List<Pattern>
getExcludePatterns()
PluginScanConfig
getExecutionDirScanConfig(org.apache.maven.model.Plugin plugin, org.apache.maven.model.PluginExecution exec)
List<Exclude>
getGlobalExcludePaths()
List<Include>
getGlobalIncludePaths()
HashFactory
getHashFactory()
String
getId()
String
getLocalRepositoryLocation()
List<PropertyName>
getLoggedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
int
getMaxLocalBuildsCached()
MultiModule
getMultiModule()
List<PropertyName>
getNologProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
PluginScanConfig
getPluginDirScanConfig(org.apache.maven.model.Plugin plugin)
List<TrackedProperty>
getTrackedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
String
getTransport()
String
getUrl()
CacheState
initialize()
boolean
isBaselineDiffEnabled()
boolean
isEnabled()
boolean
isFailFast()
boolean
isForcedExecution(org.apache.maven.plugin.MojoExecution execution)
boolean
isLazyRestore()
Artifacts restore policy.boolean
isLogAllProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
boolean
isMandatoryClean()
Flag to save in cache only if a build went through the clean lifecycleString
isProcessPlugins()
boolean
isRemoteCacheEnabled()
boolean
isRestoreGeneratedSources()
Flag to restore (default) or not generated sources as it might be desired to disable it in continuous integration scenariosboolean
isRestoreOnDiskArtifacts()
Flag to restore (default) or not generated artifactsboolean
isSaveToRemote()
boolean
isSaveToRemoteFinal()
boolean
isSkipCache()
boolean
isSkipSave()
Flag to disable cache saving
-
-
-
Field Detail
-
CONFIG_PATH_PROPERTY_NAME
public static final String CONFIG_PATH_PROPERTY_NAME
- See Also:
- Constant Field Values
-
CACHE_ENABLED_PROPERTY_NAME
public static final String CACHE_ENABLED_PROPERTY_NAME
- See Also:
- Constant Field Values
-
CACHE_LOCATION_PROPERTY_NAME
public static final String CACHE_LOCATION_PROPERTY_NAME
- See Also:
- Constant Field Values
-
REMOTE_ENABLED_PROPERTY_NAME
public static final String REMOTE_ENABLED_PROPERTY_NAME
- See Also:
- Constant Field Values
-
REMOTE_URL_PROPERTY_NAME
public static final String REMOTE_URL_PROPERTY_NAME
- See Also:
- Constant Field Values
-
REMOTE_SERVER_ID_PROPERTY_NAME
public static final String REMOTE_SERVER_ID_PROPERTY_NAME
- See Also:
- Constant Field Values
-
SAVE_TO_REMOTE_PROPERTY_NAME
public static final String SAVE_TO_REMOTE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
SAVE_NON_OVERRIDEABLE_NAME
public static final String SAVE_NON_OVERRIDEABLE_NAME
- See Also:
- Constant Field Values
-
FAIL_FAST_PROPERTY_NAME
public static final String FAIL_FAST_PROPERTY_NAME
- See Also:
- Constant Field Values
-
BASELINE_BUILD_URL_PROPERTY_NAME
public static final String BASELINE_BUILD_URL_PROPERTY_NAME
- See Also:
- Constant Field Values
-
LAZY_RESTORE_PROPERTY_NAME
public static final String LAZY_RESTORE_PROPERTY_NAME
- See Also:
- Constant Field Values
-
RESTORE_ON_DISK_ARTIFACTS_PROPERTY_NAME
public static final String RESTORE_ON_DISK_ARTIFACTS_PROPERTY_NAME
- See Also:
- Constant Field Values
-
RESTORE_GENERATED_SOURCES_PROPERTY_NAME
public static final String RESTORE_GENERATED_SOURCES_PROPERTY_NAME
- See Also:
- Constant Field Values
-
ALWAYS_RUN_PLUGINS
public static final String ALWAYS_RUN_PLUGINS
- See Also:
- Constant Field Values
-
MANDATORY_CLEAN
public static final String MANDATORY_CLEAN
- See Also:
- Constant Field Values
-
CACHE_SKIP
public static final String CACHE_SKIP
Flag to control if we should skip lookup for cached artifacts globally or for a particular project even if qualifying artifacts exist in build cache. E.g. to trigger a forced build (full or for a particular module) May be also activated via properties for projects via a profile e.g. on CI when some files produced by the build are required (e.g. smth. from target folder as additional CI build artifacts):<maven.build.cache.skipCache>true<maven.build.cache.skipCache/>
- See Also:
- Constant Field Values
-
SKIP_SAVE
public static final String SKIP_SAVE
Flag to disable cache saving- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CacheConfigImpl
@Inject public CacheConfigImpl(XmlService xmlService, org.apache.maven.execution.MavenSession session, org.apache.maven.rtinfo.RuntimeInformation rtInfo)
-
-
Method Detail
-
initialize
@Nonnull public CacheState initialize()
- Specified by:
initialize
in interfaceCacheConfig
-
getTrackedProperties
@Nonnull public List<TrackedProperty> getTrackedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getTrackedProperties
in interfaceCacheConfig
-
isLogAllProperties
public boolean isLogAllProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
isLogAllProperties
in interfaceCacheConfig
-
getLoggedProperties
@Nonnull public List<PropertyName> getLoggedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getLoggedProperties
in interfaceCacheConfig
-
getNologProperties
@Nonnull public List<PropertyName> getNologProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getNologProperties
in interfaceCacheConfig
-
getEffectivePomExcludeProperties
@Nonnull public List<String> getEffectivePomExcludeProperties(org.apache.maven.model.Plugin plugin)
- Specified by:
getEffectivePomExcludeProperties
in interfaceCacheConfig
-
getMultiModule
@Nullable public MultiModule getMultiModule()
- Specified by:
getMultiModule
in interfaceCacheConfig
-
getPluginDirScanConfig
@Nonnull public PluginScanConfig getPluginDirScanConfig(org.apache.maven.model.Plugin plugin)
- Specified by:
getPluginDirScanConfig
in interfaceCacheConfig
-
getExecutionDirScanConfig
@Nonnull public PluginScanConfig getExecutionDirScanConfig(org.apache.maven.model.Plugin plugin, org.apache.maven.model.PluginExecution exec)
- Specified by:
getExecutionDirScanConfig
in interfaceCacheConfig
-
isProcessPlugins
public String isProcessPlugins()
- Specified by:
isProcessPlugins
in interfaceCacheConfig
-
getDefaultGlob
public String getDefaultGlob()
- Specified by:
getDefaultGlob
in interfaceCacheConfig
-
getGlobalIncludePaths
@Nonnull public List<Include> getGlobalIncludePaths()
- Specified by:
getGlobalIncludePaths
in interfaceCacheConfig
-
getGlobalExcludePaths
@Nonnull public List<Exclude> getGlobalExcludePaths()
- Specified by:
getGlobalExcludePaths
in interfaceCacheConfig
-
getHashFactory
@Nonnull public HashFactory getHashFactory()
- Specified by:
getHashFactory
in interfaceCacheConfig
-
canIgnore
public boolean canIgnore(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
canIgnore
in interfaceCacheConfig
-
isForcedExecution
public boolean isForcedExecution(org.apache.maven.plugin.MojoExecution execution)
- Specified by:
isForcedExecution
in interfaceCacheConfig
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceCacheConfig
-
isRemoteCacheEnabled
public boolean isRemoteCacheEnabled()
- Specified by:
isRemoteCacheEnabled
in interfaceCacheConfig
-
isSaveToRemote
public boolean isSaveToRemote()
- Specified by:
isSaveToRemote
in interfaceCacheConfig
-
isSaveToRemoteFinal
public boolean isSaveToRemoteFinal()
- Specified by:
isSaveToRemoteFinal
in interfaceCacheConfig
-
isSkipCache
public boolean isSkipCache()
- Specified by:
isSkipCache
in interfaceCacheConfig
-
isFailFast
public boolean isFailFast()
- Specified by:
isFailFast
in interfaceCacheConfig
-
isBaselineDiffEnabled
public boolean isBaselineDiffEnabled()
- Specified by:
isBaselineDiffEnabled
in interfaceCacheConfig
-
getBaselineCacheUrl
public String getBaselineCacheUrl()
- Specified by:
getBaselineCacheUrl
in interfaceCacheConfig
-
isLazyRestore
public boolean isLazyRestore()
Description copied from interface:CacheConfig
Artifacts restore policy. Eager policy (default) resolves all cached artifacts before restoring project and allows safe to fallback ro normal execution in case of restore failure. Lazy policy restores artifacts on demand minimizing need for downloading any artifacts from cacheUse: -Dmaven.build.cache.lazyRestore=(true|false)
- Specified by:
isLazyRestore
in interfaceCacheConfig
-
isRestoreGeneratedSources
public boolean isRestoreGeneratedSources()
Description copied from interface:CacheConfig
Flag to restore (default) or not generated sources as it might be desired to disable it in continuous integration scenarios- Specified by:
isRestoreGeneratedSources
in interfaceCacheConfig
-
isRestoreOnDiskArtifacts
public boolean isRestoreOnDiskArtifacts()
Description copied from interface:CacheConfig
Flag to restore (default) or not generated artifacts- Specified by:
isRestoreOnDiskArtifacts
in interfaceCacheConfig
-
getAlwaysRunPlugins
public String getAlwaysRunPlugins()
- Specified by:
getAlwaysRunPlugins
in interfaceCacheConfig
-
isSkipSave
public boolean isSkipSave()
Description copied from interface:CacheConfig
Flag to disable cache saving- Specified by:
isSkipSave
in interfaceCacheConfig
-
isMandatoryClean
public boolean isMandatoryClean()
Description copied from interface:CacheConfig
Flag to save in cache only if a build went through the clean lifecycle- Specified by:
isMandatoryClean
in interfaceCacheConfig
-
getId
public String getId()
- Specified by:
getId
in interfaceCacheConfig
-
getUrl
public String getUrl()
- Specified by:
getUrl
in interfaceCacheConfig
-
getTransport
public String getTransport()
- Specified by:
getTransport
in interfaceCacheConfig
-
getMaxLocalBuildsCached
public int getMaxLocalBuildsCached()
- Specified by:
getMaxLocalBuildsCached
in interfaceCacheConfig
-
getLocalRepositoryLocation
public String getLocalRepositoryLocation()
- Specified by:
getLocalRepositoryLocation
in interfaceCacheConfig
-
getAttachedOutputs
public List<DirName> getAttachedOutputs()
- Specified by:
getAttachedOutputs
in interfaceCacheConfig
-
adjustMetaInfVersion
public boolean adjustMetaInfVersion()
- Specified by:
adjustMetaInfVersion
in interfaceCacheConfig
-
calculateProjectVersionChecksum
public boolean calculateProjectVersionChecksum()
- Specified by:
calculateProjectVersionChecksum
in interfaceCacheConfig
-
getExcludePatterns
@Nonnull public List<Pattern> getExcludePatterns()
- Specified by:
getExcludePatterns
in interfaceCacheConfig
-
-