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 TypeMethodDescriptionvoidaddAllVariables(Map<?, ?> variables) voidaddAllVariables(Map<?, ?> variables, boolean overwrite) voidaddClasspathURL(URL url) voidvoidaddConfigured(ArchivePacking packing) voidaddConfigured(NamedTimeoutConstraint timeoutConstraint) voidaddConfigured(CircularDependencyStrategy strategy) voidvoidaddConfigured(LatestStrategy latest) voidaddConfigured(LockStrategy lockStrategy) voidvoidvoidaddConfigured(ModuleDescriptorParser parser) voidaddConfigured(ReportOutputter outputter) voidaddConfigured(AbstractWorkspaceResolver workspaceResolver) voidaddConfigured(DependencyResolver resolver) voidaddConfigured(SignatureGenerator generator) voidaddConfigured(Trigger trigger) voidaddConfigured(VersionMatcher vmatcher) voidaddConflictManager(String name, ConflictManager cm) voidaddLatestStrategy(String name, LatestStrategy latest) voidaddLockStrategy(String name, LockStrategy lockStrategy) voidvoidaddModuleConfiguration(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 attributesvoidvoidaddReportOutputter(ReportOutputter outputter) voidvoidaddResolver(DependencyResolver resolver) voidaddSignatureGenerator(SignatureGenerator generator) voidaddTrigger(Trigger trigger) voidaddVersionMatcher(VersionMatcher vmatcher) voidvoidconfigureRepositories(boolean remote) Call this method to ask ivy to configure some variables using either a remote or a local properties filebooleanbooleanvoidDefault 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.booleanbooleanvoidfilterIgnore(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 URLgetDefaultBranch(ModuleId moduleId) static URLstatic URLString[]Returns the file names of the files that should be ignored when creating a file listing.final longgetLatestStrategy(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 NamespacegetTimeoutConstraint(String name) Class<?> getTypeDef(String name) getVariable(String name) booleangetVariableAsBoolean(String name, boolean valueIfUnset) Returns a variable as boolean value.Returns the variables loaded in configuration file.getVersionMatcher(String name) booleanhasResolver(String resolverName) booleanbooleanbooleanvoidvoidvoidvoidvoidloadProperties(File file) voidloadProperties(File file, boolean overwrite) voidloadProperties(URL url) voidloadProperties(URL url, boolean overwrite) booleanbooleanbooleanbooleanresolveFile(String fileName) Return the canonical form of a filename.voidsetBaseDir(File baseDir) voidsetCheckUpToDate(boolean checkUpToDate) voidvoidsetDefaultBranch(String defaultBranch) voidsetDefaultCache(File cacheDirectory) voidsetDefaultCacheArtifactPattern(String defaultCacheArtifactPattern) voidsetDefaultCacheIvyPattern(String defaultCacheIvyPattern) voidsetDefaultConflictManager(ConflictManager defaultConflictManager) voidsetDefaultIvyUserDir(File defaultUserDir) voidsetDefaultLatestStrategy(LatestStrategy defaultLatestStrategy) voidsetDefaultLockStrategy(LockStrategy defaultLockStrategy) voidsetDefaultRepositoryCacheBasedir(String repositoryCacheRoot) voidvoidsetDefaultResolutionCacheBasedir(String resolutionCacheRoot) voidsetDefaultResolveMode(String defaultResolveMode) voidsetDefaultResolver(String resolverName) voidsetDefaultUseOrigin(boolean useOrigin) voidsetDictatorResolver(DependencyResolver resolver) voidsetLogNotConvertedExclusionRule(boolean logNotConvertedExclusionRule) voidsetResolutionCacheManager(ResolutionCacheManager resolutionCacheManager) voidsetSettingsVariables(File settingsFile) voidsetSettingsVariables(URL settingsURL) voidsetStatusManager(StatusManager statusManager) voidsetUseRemoteConfig(boolean useRemoteConfig) voidsetValidate(boolean validate) voidsetVariable(String varName, String value) voidsetVariable(String varName, String value, boolean overwrite) voidsetVariable(String varName, String value, boolean overwrite, String ifSetVar, String unlessSetVar) voidsetVariableContainer(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<?> voidtypeDefs(InputStream stream) voidtypeDefs(InputStream stream, boolean silentFail) voidvoidtypeDefs(Properties p, boolean silentFail) voidvoidvalidate()Validates the settings, throwing anIllegalStateExceptionif 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:
configureRepositoriesin interfaceResolverSettings- Parameters:
remote- boolean
-
typeDefs
- Throws:
IOException
-
typeDefs
- Throws:
IOException
-
typeDefs
-
typeDefs
-
load
- Throws:
ParseExceptionIOException
-
load
- Throws:
ParseExceptionIOException
-
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:
ParseExceptionIOException
-
loadDefault14
- Throws:
ParseExceptionIOException
-
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:
substitutein interfaceDeliverEngineSettings- Specified by:
substitutein interfaceParserSettings- Specified by:
substitutein 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:
substitutein 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:
getVariablesin interfaceRetrieveEngineSettings- Returns:
- IvyVariableContainer
-
typeDef
-
typeDef
-
addClasspathURL
-
getTypeDefs
-
getTypeDef
-
addConfigured
-
addConfigured
-
addConfigured
-
addSignatureGenerator
-
getSignatureGenerator
- Specified by:
getSignatureGeneratorin 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:
resolveFilein 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:
setDictatorResolverin interfaceResolveEngineSettings
-
getResolver
- Specified by:
getResolverin interfaceParserSettings
-
hasResolver
-
getResolver
- Specified by:
getResolverin interfaceCheckEngineSettings- Specified by:
getResolverin interfaceInstallEngineSettings- Specified by:
getResolverin interfacePublishEngineSettings
-
getDefaultResolver
-
getResolverName
- Specified by:
getResolverNamein interfaceResolveEngineSettings
-
getDefaultBranch
- Specified by:
getDefaultBranchin interfaceParserSettings
-
getDefaultBranch
-
setDefaultBranch
-
getConflictManager
- Specified by:
getConflictManagerin interfaceResolveEngineSettings
-
getResolveMode
- Specified by:
getResolveModein interfaceResolverSettings
-
getDefaultResolveMode
-
setDefaultResolveMode
-
addConfigured
-
getConflictManager
- Specified by:
getConflictManagerin interfaceParserSettings
-
addConflictManager
-
addConfigured
-
getLatestStrategy
- Specified by:
getLatestStrategyin interfaceResolverSettings
-
addLatestStrategy
-
addConfigured
-
getLockStrategy
-
addLockStrategy
-
addConfigured
-
getNamespace
- Specified by:
getNamespacein interfaceParserSettings- Specified by:
getNamespacein interfaceResolverSettings
-
getSystemNamespace
- Specified by:
getSystemNamespacein interfaceResolverSettings
-
addNamespace
-
addConfigured
-
getTimeoutConstraint
- Specified by:
getTimeoutConstraintin interfaceParserSettings- Parameters:
name- The name of theTimeoutConstraint- Returns:
- Returns a
TimeoutConstraintwhich is identified by the passedname. Returns null if no suchTimeoutConstraintexists
-
addConfigured
-
getMatcher
- Specified by:
getMatcherin interfaceInstallEngineSettings- Specified by:
getMatcherin interfaceParserSettings
-
addMatcher
-
addConfigured
-
getRepositoryCacheManager
- Specified by:
getRepositoryCacheManagerin interfaceResolverSettings
-
addRepositoryCacheManager
-
getRepositoryCacheManagers
- Specified by:
getRepositoryCacheManagersin interfaceResolverSettings
-
addConfigured
-
getReportOutputter
-
addReportOutputter
-
getReportOutputters
- Specified by:
getReportOutputtersin interfaceInstallEngineSettings- Specified by:
getReportOutputtersin interfaceResolveEngineSettings
-
addConfigured
-
getVersionMatcher
-
addVersionMatcher
-
getVersionMatchers
-
getVersionMatcher
- Specified by:
getVersionMatcherin interfaceResolverSettings- Specified by:
getVersionMatcherin interfaceSortEngineSettings
-
configureDefaultVersionMatcher
public void configureDefaultVersionMatcher() -
getCircularDependencyStrategy
- Specified by:
getCircularDependencyStrategyin interfaceSortEngineSettings
-
getCircularDependencyStrategy
-
setCircularDependencyStrategy
-
addConfigured
-
getStatusManager
- Specified by:
getStatusManagerin interfaceInstallEngineSettings- Specified by:
getStatusManagerin interfaceParserSettings
-
setStatusManager
-
getIgnorableFilenames
Returns the file names of the files that should be ignored when creating a file listing.- Specified by:
getIgnorableFilenamesin 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:
filterIgnorein interfaceResolverSettings- Parameters:
names- ditto
-
isCheckUpToDate
public boolean isCheckUpToDate()- Specified by:
isCheckUpToDatein interfaceRetrieveEngineSettings
-
setCheckUpToDate
public void setCheckUpToDate(boolean checkUpToDate) -
doValidate
public boolean doValidate()- Specified by:
doValidatein interfaceCheckEngineSettings
-
setValidate
public void setValidate(boolean validate) -
getVariable
- Specified by:
getVariablein interfaceParserSettings- Specified by:
getVariablein 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:
getDefaultLatestStrategyin interfaceResolverSettings
-
setDefaultLatestStrategy
-
getDefaultLockStrategy
-
setDefaultLockStrategy
-
getDefaultRepositoryCacheManager
- Specified by:
getDefaultRepositoryCacheManagerin interfaceResolverSettings
-
setDefaultRepositoryCacheManager
-
getResolutionCacheManager
- Specified by:
getResolutionCacheManagerin 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:
logModuleWhenFoundin interfaceResolveEngineSettings
-
logResolvedRevision
public boolean logResolvedRevision()- Specified by:
logResolvedRevisionin interfaceResolveEngineSettings
-
debugConflictResolution
public boolean debugConflictResolution()- Specified by:
debugConflictResolutionin interfaceResolveEngineSettings
-
debugLocking
public boolean debugLocking() -
dumpMemoryUsage
public boolean dumpMemoryUsage()- Specified by:
dumpMemoryUsagein interfaceRepositoryManagementEngineSettings
-
logNotConvertedExclusionRule
public boolean logNotConvertedExclusionRule()- Specified by:
logNotConvertedExclusionRulein interfaceInstallEngineSettings- Specified by:
logNotConvertedExclusionRulein interfaceResolveEngineSettings
-
setLogNotConvertedExclusionRule
public void setLogNotConvertedExclusionRule(boolean logNotConvertedExclusionRule) - Specified by:
setLogNotConvertedExclusionRulein interfaceInstallEngineSettings
-
getInterruptTimeout
public final long getInterruptTimeout() -
getResolvers
-
getResolverNames
- Specified by:
getResolverNamesin interfaceInstallEngineSettings
-
getMatcherNames
- Specified by:
getMatcherNamesin interfaceInstallEngineSettings
-
getVariableContainer
-
setVariableContainer
Use a different variable container.- Parameters:
variables- IvyVariableContainer
-
getRelativeUrlResolver
- Specified by:
getRelativeUrlResolverin 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 anIllegalStateExceptionif the current state is not valid.- Throws:
IllegalStateException- if the settings is not valid.
-
getContextNamespace
- Specified by:
getContextNamespacein interfaceParserSettings- Returns:
- the namespace context in which the current descriptor is parsed.
-
addConfigured
-
getPackingRegistry
-
addConfigured
-