Package org.apache.ivy.core.settings
Class IvySettings
java.lang.Object
org.apache.ivy.core.settings.IvySettings
- All Implemented Interfaces:
CheckEngineSettings
,DeliverEngineSettings
,InstallEngineSettings
,PublishEngineSettings
,RepositoryManagementEngineSettings
,ResolveEngineSettings
,RetrieveEngineSettings
,SortEngineSettings
,ParserSettings
,ResolverSettings
public class IvySettings
extends Object
implements SortEngineSettings, PublishEngineSettings, ParserSettings, DeliverEngineSettings, CheckEngineSettings, InstallEngineSettings, ResolverSettings, ResolveEngineSettings, RetrieveEngineSettings, RepositoryManagementEngineSettings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllVariables
(Map<?, ?> variables) void
addAllVariables
(Map<?, ?> variables, boolean overwrite) void
addClasspathURL
(URL url) void
void
addConfigured
(ArchivePacking packing) void
addConfigured
(NamedTimeoutConstraint timeoutConstraint) void
addConfigured
(CircularDependencyStrategy strategy) void
void
addConfigured
(LatestStrategy latest) void
addConfigured
(LockStrategy lockStrategy) void
void
void
addConfigured
(ModuleDescriptorParser parser) void
addConfigured
(ReportOutputter outputter) void
addConfigured
(AbstractWorkspaceResolver workspaceResolver) void
addConfigured
(DependencyResolver resolver) void
addConfigured
(SignatureGenerator generator) void
addConfigured
(Trigger trigger) void
addConfigured
(VersionMatcher vmatcher) void
addConflictManager
(String name, ConflictManager cm) void
addLatestStrategy
(String name, LatestStrategy latest) void
addLockStrategy
(String name, LockStrategy lockStrategy) void
void
addModuleConfiguration
(Map<String, String> attributes, PatternMatcher matcher, String resolverName, String branch, String conflictManager, String resolveMode) regular expressions as explained in Pattern class may be used in attributesvoid
void
addReportOutputter
(ReportOutputter outputter) void
void
addResolver
(DependencyResolver resolver) void
addSignatureGenerator
(SignatureGenerator generator) void
addTrigger
(Trigger trigger) void
addVersionMatcher
(VersionMatcher vmatcher) void
void
configureRepositories
(boolean remote) Call this method to ask ivy to configure some variables using either a remote or a local properties fileboolean
boolean
void
Default initialization of settings, useful when you don't want to load your settings from a settings file or URL, but prefer to set them manually.boolean
boolean
void
filterIgnore
(Collection<String> names) Filters the names list by removing all names that should be ignored as defined by the listing ignore listgetConflictManager
(String name) getConflictManager
(ModuleId moduleId) static URL
getDefaultBranch
(ModuleId moduleId) static URL
static URL
String[]
Returns the file names of the files that should be ignored when creating a file listing.final long
getLatestStrategy
(String name) getLockStrategy
(String name) getMatcher
(String name) getNamespace
(String name) getReportOutputter
(String name) getResolveMode
(ModuleId moduleId) getResolver
(String resolverName) getResolver
(ModuleRevisionId mrid) getSignatureGenerator
(String name) final Namespace
getTimeoutConstraint
(String name) Class<?>
getTypeDef
(String name) getVariable
(String name) boolean
getVariableAsBoolean
(String name, boolean valueIfUnset) Returns a variable as boolean value.Returns the variables loaded in configuration file.getVersionMatcher
(String name) boolean
hasResolver
(String resolverName) boolean
boolean
boolean
void
void
void
void
void
loadProperties
(File file) void
loadProperties
(File file, boolean overwrite) void
loadProperties
(URL url) void
loadProperties
(URL url, boolean overwrite) boolean
boolean
boolean
boolean
resolveFile
(String fileName) Return the canonical form of a filename.void
setBaseDir
(File baseDir) void
setCheckUpToDate
(boolean checkUpToDate) void
void
setDefaultBranch
(String defaultBranch) void
setDefaultCache
(File cacheDirectory) void
setDefaultCacheArtifactPattern
(String defaultCacheArtifactPattern) void
setDefaultCacheIvyPattern
(String defaultCacheIvyPattern) void
setDefaultConflictManager
(ConflictManager defaultConflictManager) void
setDefaultIvyUserDir
(File defaultUserDir) void
setDefaultLatestStrategy
(LatestStrategy defaultLatestStrategy) void
setDefaultLockStrategy
(LockStrategy defaultLockStrategy) void
setDefaultRepositoryCacheBasedir
(String repositoryCacheRoot) void
void
setDefaultResolutionCacheBasedir
(String resolutionCacheRoot) void
setDefaultResolveMode
(String defaultResolveMode) void
setDefaultResolver
(String resolverName) void
setDefaultUseOrigin
(boolean useOrigin) void
setDictatorResolver
(DependencyResolver resolver) void
setLogNotConvertedExclusionRule
(boolean logNotConvertedExclusionRule) void
setResolutionCacheManager
(ResolutionCacheManager resolutionCacheManager) void
setSettingsVariables
(File settingsFile) void
setSettingsVariables
(URL settingsURL) void
setStatusManager
(StatusManager statusManager) void
setUseRemoteConfig
(boolean useRemoteConfig) void
setValidate
(boolean validate) void
setVariable
(String varName, String value) void
setVariable
(String varName, String value, boolean overwrite) void
setVariable
(String varName, String value, boolean overwrite, String ifSetVar, String unlessSetVar) void
setVariableContainer
(IvyVariableContainer variables) Use a different variable container.substitute
(String str) Substitute variables in the given string by their value found in the current set of variablessubstitute
(Map<String, String> strings) Substitute variables in the given map values by their value found in the current set of variablesClass<?>
Class<?>
void
typeDefs
(InputStream stream) void
typeDefs
(InputStream stream, boolean silentFail) void
void
typeDefs
(Properties p, boolean silentFail) void
void
validate()
Validates the settings, throwing anIllegalStateException
if the current state is not valid.
-
Constructor Details
-
IvySettings
public IvySettings() -
IvySettings
-
-
Method Details
-
configureRepositories
public void configureRepositories(boolean remote) Call this method to ask ivy to configure some variables using either a remote or a local properties file- Specified by:
configureRepositories
in interfaceResolverSettings
- Parameters:
remote
- boolean
-
typeDefs
- Throws:
IOException
-
typeDefs
- Throws:
IOException
-
typeDefs
-
typeDefs
-
load
- Throws:
ParseException
IOException
-
load
- Throws:
ParseException
IOException
-
defaultInit
Default initialization of settings, useful when you don't want to load your settings from a settings file or URL, but prefer to set them manually. By calling this method you will still have the basic initialization done when loading settings.- Throws:
IOException
- if something goes wrong
-
loadDefault
- Throws:
ParseException
IOException
-
loadDefault14
- Throws:
ParseException
IOException
-
getDefaultPropertiesURL
-
getDefaultSettingsURL
-
getDefault14SettingsURL
-
setSettingsVariables
-
setSettingsVariables
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
setVariable
-
setVariable
-
setVariable
-
addAllVariables
-
addAllVariables
-
substitute
Substitute variables in the given string by their value found in the current set of variables- Specified by:
substitute
in interfaceDeliverEngineSettings
- Specified by:
substitute
in interfaceParserSettings
- Specified by:
substitute
in interfacePublishEngineSettings
- Parameters:
str
- the string in which substitution should be made- Returns:
- the string where all current ivy variables have been substituted by their value If the input str doesn't use any variable, the same object is returned
-
substitute
Substitute variables in the given map values by their value found in the current set of variables- Specified by:
substitute
in interfaceParserSettings
- Parameters:
strings
- the map of strings in which substitution should be made- Returns:
- a new map of strings in which all current ivy variables in values have been substituted by their value
-
getVariables
Returns the variables loaded in configuration file. Those variables may better be seen as ant properties- Specified by:
getVariables
in interfaceRetrieveEngineSettings
- Returns:
- IvyVariableContainer
-
typeDef
-
typeDef
-
addClasspathURL
-
getTypeDefs
-
getTypeDef
-
addConfigured
-
addConfigured
-
addConfigured
-
addSignatureGenerator
-
getSignatureGenerator
- Specified by:
getSignatureGenerator
in interfaceResolverSettings
-
addResolver
-
setDefaultCache
-
setDefaultResolver
-
addModuleConfiguration
public void addModuleConfiguration(Map<String, String> attributes, PatternMatcher matcher, String resolverName, String branch, String conflictManager, String resolveMode) regular expressions as explained in Pattern class may be used in attributes- Parameters:
attributes
- Mapmatcher
- PatternMatcherresolverName
- Stringbranch
- StringconflictManager
- StringresolveMode
- String
-
resolveFile
Return the canonical form of a filename.If the specified file name is relative it is resolved with respect to the settings's base directory.
- Specified by:
resolveFile
in interfaceParserSettings
- Parameters:
fileName
- The name of the file to resolve. Must not benull
.- Returns:
- the resolved File.
-
setBaseDir
-
getBaseDir
-
getDefaultIvyUserDir
-
setDefaultIvyUserDir
-
getDefaultCache
-
setDefaultRepositoryCacheBasedir
-
setDefaultResolutionCacheBasedir
-
getDefaultRepositoryCacheBasedir
-
getDefaultResolutionCacheBasedir
-
setDictatorResolver
- Specified by:
setDictatorResolver
in interfaceResolveEngineSettings
-
getResolver
- Specified by:
getResolver
in interfaceParserSettings
-
hasResolver
-
getResolver
- Specified by:
getResolver
in interfaceCheckEngineSettings
- Specified by:
getResolver
in interfaceInstallEngineSettings
- Specified by:
getResolver
in interfacePublishEngineSettings
-
getDefaultResolver
-
getResolverName
- Specified by:
getResolverName
in interfaceResolveEngineSettings
-
getDefaultBranch
- Specified by:
getDefaultBranch
in interfaceParserSettings
-
getDefaultBranch
-
setDefaultBranch
-
getConflictManager
- Specified by:
getConflictManager
in interfaceResolveEngineSettings
-
getResolveMode
- Specified by:
getResolveMode
in interfaceResolverSettings
-
getDefaultResolveMode
-
setDefaultResolveMode
-
addConfigured
-
getConflictManager
- Specified by:
getConflictManager
in interfaceParserSettings
-
addConflictManager
-
addConfigured
-
getLatestStrategy
- Specified by:
getLatestStrategy
in interfaceResolverSettings
-
addLatestStrategy
-
addConfigured
-
getLockStrategy
-
addLockStrategy
-
addConfigured
-
getNamespace
- Specified by:
getNamespace
in interfaceParserSettings
- Specified by:
getNamespace
in interfaceResolverSettings
-
getSystemNamespace
- Specified by:
getSystemNamespace
in interfaceResolverSettings
-
addNamespace
-
addConfigured
-
getTimeoutConstraint
- Specified by:
getTimeoutConstraint
in interfaceParserSettings
- Parameters:
name
- The name of theTimeoutConstraint
- Returns:
- Returns a
TimeoutConstraint
which is identified by the passedname
. Returns null if no suchTimeoutConstraint
exists
-
addConfigured
-
getMatcher
- Specified by:
getMatcher
in interfaceInstallEngineSettings
- Specified by:
getMatcher
in interfaceParserSettings
-
addMatcher
-
addConfigured
-
getRepositoryCacheManager
- Specified by:
getRepositoryCacheManager
in interfaceResolverSettings
-
addRepositoryCacheManager
-
getRepositoryCacheManagers
- Specified by:
getRepositoryCacheManagers
in interfaceResolverSettings
-
addConfigured
-
getReportOutputter
-
addReportOutputter
-
getReportOutputters
- Specified by:
getReportOutputters
in interfaceInstallEngineSettings
- Specified by:
getReportOutputters
in interfaceResolveEngineSettings
-
addConfigured
-
getVersionMatcher
-
addVersionMatcher
-
getVersionMatchers
-
getVersionMatcher
- Specified by:
getVersionMatcher
in interfaceResolverSettings
- Specified by:
getVersionMatcher
in interfaceSortEngineSettings
-
configureDefaultVersionMatcher
public void configureDefaultVersionMatcher() -
getCircularDependencyStrategy
- Specified by:
getCircularDependencyStrategy
in interfaceSortEngineSettings
-
getCircularDependencyStrategy
-
setCircularDependencyStrategy
-
addConfigured
-
getStatusManager
- Specified by:
getStatusManager
in interfaceInstallEngineSettings
- Specified by:
getStatusManager
in interfaceParserSettings
-
setStatusManager
-
getIgnorableFilenames
Returns the file names of the files that should be ignored when creating a file listing.- Specified by:
getIgnorableFilenames
in interfaceRetrieveEngineSettings
- Returns:
- String[]
-
filterIgnore
Filters the names list by removing all names that should be ignored as defined by the listing ignore list- Specified by:
filterIgnore
in interfaceResolverSettings
- Parameters:
names
- ditto
-
isCheckUpToDate
public boolean isCheckUpToDate()- Specified by:
isCheckUpToDate
in interfaceRetrieveEngineSettings
-
setCheckUpToDate
public void setCheckUpToDate(boolean checkUpToDate) -
doValidate
public boolean doValidate()- Specified by:
doValidate
in interfaceCheckEngineSettings
-
setValidate
public void setValidate(boolean validate) -
getVariable
- Specified by:
getVariable
in interfaceParserSettings
- Specified by:
getVariable
in interfaceResolverSettings
-
getVariableAsBoolean
Returns a variable as boolean value.- Parameters:
name
- name of the variablevalueIfUnset
- value if the variable is unset- Returns:
- true if the variable is 'true' (ignoring case) or the value of valueIfUnset if the variable is null
-
getDefaultConflictManager
-
setDefaultConflictManager
-
getDefaultLatestStrategy
- Specified by:
getDefaultLatestStrategy
in interfaceResolverSettings
-
setDefaultLatestStrategy
-
getDefaultLockStrategy
-
setDefaultLockStrategy
-
getDefaultRepositoryCacheManager
- Specified by:
getDefaultRepositoryCacheManager
in interfaceResolverSettings
-
setDefaultRepositoryCacheManager
-
getResolutionCacheManager
- Specified by:
getResolutionCacheManager
in interfaceParserSettings
-
setResolutionCacheManager
-
addTrigger
-
getTriggers
-
addConfigured
-
isUseRemoteConfig
public boolean isUseRemoteConfig() -
setUseRemoteConfig
public void setUseRemoteConfig(boolean useRemoteConfig) -
logModulesInUse
public boolean logModulesInUse() -
logModuleWhenFound
public boolean logModuleWhenFound()- Specified by:
logModuleWhenFound
in interfaceResolveEngineSettings
-
logResolvedRevision
public boolean logResolvedRevision()- Specified by:
logResolvedRevision
in interfaceResolveEngineSettings
-
debugConflictResolution
public boolean debugConflictResolution()- Specified by:
debugConflictResolution
in interfaceResolveEngineSettings
-
debugLocking
public boolean debugLocking() -
dumpMemoryUsage
public boolean dumpMemoryUsage()- Specified by:
dumpMemoryUsage
in interfaceRepositoryManagementEngineSettings
-
logNotConvertedExclusionRule
public boolean logNotConvertedExclusionRule()- Specified by:
logNotConvertedExclusionRule
in interfaceInstallEngineSettings
- Specified by:
logNotConvertedExclusionRule
in interfaceResolveEngineSettings
-
setLogNotConvertedExclusionRule
public void setLogNotConvertedExclusionRule(boolean logNotConvertedExclusionRule) - Specified by:
setLogNotConvertedExclusionRule
in interfaceInstallEngineSettings
-
getInterruptTimeout
public final long getInterruptTimeout() -
getResolvers
-
getResolverNames
- Specified by:
getResolverNames
in interfaceInstallEngineSettings
-
getMatcherNames
- Specified by:
getMatcherNames
in interfaceInstallEngineSettings
-
getVariableContainer
-
setVariableContainer
Use a different variable container.- Parameters:
variables
- IvyVariableContainer
-
getRelativeUrlResolver
- Specified by:
getRelativeUrlResolver
in interfaceParserSettings
-
setDefaultCacheIvyPattern
-
getDefaultCacheIvyPattern
-
setDefaultCacheArtifactPattern
-
getDefaultCacheArtifactPattern
-
setDefaultUseOrigin
public void setDefaultUseOrigin(boolean useOrigin) -
isDefaultUseOrigin
public boolean isDefaultUseOrigin() -
useDeprecatedUseOrigin
public void useDeprecatedUseOrigin() -
validate
public void validate()Validates the settings, throwing anIllegalStateException
if the current state is not valid.- Throws:
IllegalStateException
- if the settings is not valid.
-
getContextNamespace
- Specified by:
getContextNamespace
in interfaceParserSettings
- Returns:
- the namespace context in which the current descriptor is parsed.
-
addConfigured
-
getPackingRegistry
-
addConfigured
-