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 StringALWAYS_RUN_PLUGINSstatic StringBASELINE_BUILD_URL_PROPERTY_NAMEstatic StringCACHE_ENABLED_PROPERTY_NAMEstatic StringCACHE_LOCATION_PROPERTY_NAMEstatic StringCACHE_SKIPFlag 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 StringCONFIG_PATH_PROPERTY_NAMEstatic StringFAIL_FAST_PROPERTY_NAMEstatic StringLAZY_RESTORE_PROPERTY_NAMEstatic StringMANDATORY_CLEANstatic StringREMOTE_ENABLED_PROPERTY_NAMEstatic StringREMOTE_SERVER_ID_PROPERTY_NAMEstatic StringREMOTE_URL_PROPERTY_NAMEstatic StringRESTORE_GENERATED_SOURCES_PROPERTY_NAMEstatic StringRESTORE_ON_DISK_ARTIFACTS_PROPERTY_NAMEstatic StringSAVE_NON_OVERRIDEABLE_NAMEstatic StringSAVE_TO_REMOTE_PROPERTY_NAMEstatic StringSKIP_SAVEFlag 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 booleanadjustMetaInfVersion()booleancalculateProjectVersionChecksum()booleancanIgnore(org.apache.maven.plugin.MojoExecution mojoExecution)StringgetAlwaysRunPlugins()List<DirName>getAttachedOutputs()StringgetBaselineCacheUrl()StringgetDefaultGlob()List<String>getEffectivePomExcludeProperties(org.apache.maven.model.Plugin plugin)List<Pattern>getExcludePatterns()PluginScanConfiggetExecutionDirScanConfig(org.apache.maven.model.Plugin plugin, org.apache.maven.model.PluginExecution exec)List<Exclude>getGlobalExcludePaths()List<Include>getGlobalIncludePaths()HashFactorygetHashFactory()StringgetId()StringgetLocalRepositoryLocation()List<PropertyName>getLoggedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)intgetMaxLocalBuildsCached()MultiModulegetMultiModule()List<PropertyName>getNologProperties(org.apache.maven.plugin.MojoExecution mojoExecution)PluginScanConfiggetPluginDirScanConfig(org.apache.maven.model.Plugin plugin)List<TrackedProperty>getTrackedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)StringgetTransport()StringgetUrl()CacheStateinitialize()booleanisBaselineDiffEnabled()booleanisEnabled()booleanisFailFast()booleanisForcedExecution(org.apache.maven.plugin.MojoExecution execution)booleanisLazyRestore()Artifacts restore policy.booleanisLogAllProperties(org.apache.maven.plugin.MojoExecution mojoExecution)booleanisMandatoryClean()Flag to save in cache only if a build went through the clean lifecycleStringisProcessPlugins()booleanisRemoteCacheEnabled()booleanisRestoreGeneratedSources()Flag to restore (default) or not generated sources as it might be desired to disable it in continuous integration scenariosbooleanisRestoreOnDiskArtifacts()Flag to restore (default) or not generated artifactsbooleanisSaveToRemote()booleanisSaveToRemoteFinal()booleanisSkipCache()booleanisSkipSave()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:
initializein interfaceCacheConfig
-
getTrackedProperties
@Nonnull public List<TrackedProperty> getTrackedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getTrackedPropertiesin interfaceCacheConfig
-
isLogAllProperties
public boolean isLogAllProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
isLogAllPropertiesin interfaceCacheConfig
-
getLoggedProperties
@Nonnull public List<PropertyName> getLoggedProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getLoggedPropertiesin interfaceCacheConfig
-
getNologProperties
@Nonnull public List<PropertyName> getNologProperties(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
getNologPropertiesin interfaceCacheConfig
-
getEffectivePomExcludeProperties
@Nonnull public List<String> getEffectivePomExcludeProperties(org.apache.maven.model.Plugin plugin)
- Specified by:
getEffectivePomExcludePropertiesin interfaceCacheConfig
-
getMultiModule
@Nullable public MultiModule getMultiModule()
- Specified by:
getMultiModulein interfaceCacheConfig
-
getPluginDirScanConfig
@Nonnull public PluginScanConfig getPluginDirScanConfig(org.apache.maven.model.Plugin plugin)
- Specified by:
getPluginDirScanConfigin interfaceCacheConfig
-
getExecutionDirScanConfig
@Nonnull public PluginScanConfig getExecutionDirScanConfig(org.apache.maven.model.Plugin plugin, org.apache.maven.model.PluginExecution exec)
- Specified by:
getExecutionDirScanConfigin interfaceCacheConfig
-
isProcessPlugins
public String isProcessPlugins()
- Specified by:
isProcessPluginsin interfaceCacheConfig
-
getDefaultGlob
public String getDefaultGlob()
- Specified by:
getDefaultGlobin interfaceCacheConfig
-
getGlobalIncludePaths
@Nonnull public List<Include> getGlobalIncludePaths()
- Specified by:
getGlobalIncludePathsin interfaceCacheConfig
-
getGlobalExcludePaths
@Nonnull public List<Exclude> getGlobalExcludePaths()
- Specified by:
getGlobalExcludePathsin interfaceCacheConfig
-
getHashFactory
@Nonnull public HashFactory getHashFactory()
- Specified by:
getHashFactoryin interfaceCacheConfig
-
canIgnore
public boolean canIgnore(org.apache.maven.plugin.MojoExecution mojoExecution)
- Specified by:
canIgnorein interfaceCacheConfig
-
isForcedExecution
public boolean isForcedExecution(org.apache.maven.plugin.MojoExecution execution)
- Specified by:
isForcedExecutionin interfaceCacheConfig
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceCacheConfig
-
isRemoteCacheEnabled
public boolean isRemoteCacheEnabled()
- Specified by:
isRemoteCacheEnabledin interfaceCacheConfig
-
isSaveToRemote
public boolean isSaveToRemote()
- Specified by:
isSaveToRemotein interfaceCacheConfig
-
isSaveToRemoteFinal
public boolean isSaveToRemoteFinal()
- Specified by:
isSaveToRemoteFinalin interfaceCacheConfig
-
isSkipCache
public boolean isSkipCache()
- Specified by:
isSkipCachein interfaceCacheConfig
-
isFailFast
public boolean isFailFast()
- Specified by:
isFailFastin interfaceCacheConfig
-
isBaselineDiffEnabled
public boolean isBaselineDiffEnabled()
- Specified by:
isBaselineDiffEnabledin interfaceCacheConfig
-
getBaselineCacheUrl
public String getBaselineCacheUrl()
- Specified by:
getBaselineCacheUrlin interfaceCacheConfig
-
isLazyRestore
public boolean isLazyRestore()
Description copied from interface:CacheConfigArtifacts 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:
isLazyRestorein interfaceCacheConfig
-
isRestoreGeneratedSources
public boolean isRestoreGeneratedSources()
Description copied from interface:CacheConfigFlag to restore (default) or not generated sources as it might be desired to disable it in continuous integration scenarios- Specified by:
isRestoreGeneratedSourcesin interfaceCacheConfig
-
isRestoreOnDiskArtifacts
public boolean isRestoreOnDiskArtifacts()
Description copied from interface:CacheConfigFlag to restore (default) or not generated artifacts- Specified by:
isRestoreOnDiskArtifactsin interfaceCacheConfig
-
getAlwaysRunPlugins
public String getAlwaysRunPlugins()
- Specified by:
getAlwaysRunPluginsin interfaceCacheConfig
-
isSkipSave
public boolean isSkipSave()
Description copied from interface:CacheConfigFlag to disable cache saving- Specified by:
isSkipSavein interfaceCacheConfig
-
isMandatoryClean
public boolean isMandatoryClean()
Description copied from interface:CacheConfigFlag to save in cache only if a build went through the clean lifecycle- Specified by:
isMandatoryCleanin interfaceCacheConfig
-
getId
public String getId()
- Specified by:
getIdin interfaceCacheConfig
-
getUrl
public String getUrl()
- Specified by:
getUrlin interfaceCacheConfig
-
getTransport
public String getTransport()
- Specified by:
getTransportin interfaceCacheConfig
-
getMaxLocalBuildsCached
public int getMaxLocalBuildsCached()
- Specified by:
getMaxLocalBuildsCachedin interfaceCacheConfig
-
getLocalRepositoryLocation
public String getLocalRepositoryLocation()
- Specified by:
getLocalRepositoryLocationin interfaceCacheConfig
-
getAttachedOutputs
public List<DirName> getAttachedOutputs()
- Specified by:
getAttachedOutputsin interfaceCacheConfig
-
adjustMetaInfVersion
public boolean adjustMetaInfVersion()
- Specified by:
adjustMetaInfVersionin interfaceCacheConfig
-
calculateProjectVersionChecksum
public boolean calculateProjectVersionChecksum()
- Specified by:
calculateProjectVersionChecksumin interfaceCacheConfig
-
getExcludePatterns
@Nonnull public List<Pattern> getExcludePatterns()
- Specified by:
getExcludePatternsin interfaceCacheConfig
-
-