Package org.apache.ivy.plugins.resolver
Class AbstractSshBasedResolver
- java.lang.Object
-
- org.apache.ivy.plugins.resolver.AbstractResolver
-
- org.apache.ivy.plugins.resolver.BasicResolver
-
- org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
-
- org.apache.ivy.plugins.resolver.RepositoryResolver
-
- org.apache.ivy.plugins.resolver.AbstractSshBasedResolver
-
- All Implemented Interfaces:
Validatable
,DependencyResolver
,HasLatestStrategy
- Direct Known Subclasses:
SFTPResolver
,SshResolver
public abstract class AbstractSshBasedResolver extends RepositoryResolver
Abstract base class for all resolvers using SSH All necessary connection parameters can be set here via attributes. However all attributes defined in the pattern url of the resolver will have higher priority and will overwrite the values given here. To specify connection parameters in the pattern, you have to specify a full url and not just a path as pattern. e.g. pattern="/path/to/my/repos/[artifact].[ext]" will use all connection parameters from this class e.g. pattern="ssh://myserver.com/path/to/my/repos/[artifact].[ext]" will use all parameters from this class with the exception of the host, which will be "myserver.com" e.g. pattern="sftp://user:geheim@myserver.com:8022/path/to/my/repos/[artifact].[ext]" will use only the keyFile and keyFilePassword from this class (if needed). Rest will come from the url.
-
-
Field Summary
-
Fields inherited from class org.apache.ivy.plugins.resolver.BasicResolver
DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED
-
-
Constructor Summary
Constructors Constructor Description AbstractSshBasedResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
getTypeName()
void
setAllowedAgentUse(boolean allowedAgentUse)
Determines whether a local SSH agent may be used for authenticationvoid
setHost(java.lang.String host)
sets the host to use for the ssh communication the host can also be set by using a full url for the pattern, like "ssh://myserver.com/path/to/repos/[artifact].[ext]"void
setKeyFile(java.io.File filePath)
Sets the location of the Public Key file to use for authenticationvoid
setKeyFilePassword(java.lang.String password)
Sets the password to use for decrypting key file (if it is encrypted) if no password is set and the keyfile is encrypted, the user will be prompted for the password if the keyfile is passwordless, this parameter will be ignored if givenvoid
setPassfile(java.io.File passfile)
Optional password file.void
setPort(int port)
sets the port to use for the ssh communication port 22 is default the port can also be set by using a full url for the pattern, like "sftp://myserver.com:8022/path/to/repos/[artifact].[ext]"void
setSettings(IvySettings settings)
void
setSshConfig(java.lang.String sshConfig)
sets the path to an OpenSSH-style config file to be used for reading configuration values for an ssh repository, such as a usernamevoid
setUser(java.lang.String user)
sets the user to use for the ssh communication the user can also be set by using a full url for the pattern, like "ssh://user@myserver.com/path/to/repos/[artifact].[ext]"void
setUserPassword(java.lang.String password)
Sets the password to authenticate the user if password based login is used if no password is set and password based login is used, user will be prompted for it the password can also be set by using a full url for the pattern, like "sftp://user:password@myserver.com/path/to/repos/[artifact].[ext]"-
Methods inherited from class org.apache.ivy.plugins.resolver.RepositoryResolver
download, dumpSettings, exist, findResourceUsingPattern, findTokenValues, get, getDestination, getRepository, getResource, isAlwaysCheckExactRevision, listResources, listTokenValues, publish, put, putChecksum, putSignature, setAlwaysCheckExactRevision, setName, setRepository, setSettings, setSigner
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
addArtifactPattern, addConfiguredArtifact, addConfiguredIvy, addIvyPattern, convertM2CriteriaForResourceSearch, convertM2IdForResourceSearch, convertM2OrganizationForResourceSearch, convertM2ResourceSearchIdToNormal, convertM2TokenValuesForResourceSearch, findArtifactNames, findArtifactRef, findIvyFileRef, findIvyNames, findNames, findResource, findResourceUsingPatterns, getArtifactPatterns, getIvyPatterns, getModuleDescriptorExtension, isM2compatible, listTokenValues, setArtifactPatterns, setIvyPatterns, setM2compatible
-
Methods inherited from class org.apache.ivy.plugins.resolver.BasicResolver
acceptLatest, checkModuleDescriptorRevision, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, exists, filterNames, findFirstArtifactRef, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getDependency, getPublicationDate, getRMDParser, getWorkspaceName, isAllownomd, isCheckconsistency, isEnvDependent, isForce, listModules, listOrganisations, listRevisions, listTokenValues, locate, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toString
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractResolver
abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTimeoutConstraint, hidePassword, isAfter, isValidate, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setNamespace, setRepositoryCacheManager, setTimeoutConstraint, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
-
-
-
-
Method Detail
-
setKeyFile
public void setKeyFile(java.io.File filePath)
Sets the location of the Public Key file to use for authentication- Parameters:
filePath
- full file path name
-
setAllowedAgentUse
public void setAllowedAgentUse(boolean allowedAgentUse)
Determines whether a local SSH agent may be used for authentication- Parameters:
allowedAgentUse
- true if an agent may be used if available
-
setPassfile
public void setPassfile(java.io.File passfile)
Optional password file. If set the repository will use it as an encrypted property file, to load username and passwd entries, and to store them if the user choose to do so. Defaults to user.dir/.ivy/[host].sftp.passwd, set it to null to disable this feature.- Parameters:
passfile
- File
-
setSettings
public void setSettings(IvySettings settings)
-
setUserPassword
public void setUserPassword(java.lang.String password)
Sets the password to authenticate the user if password based login is used if no password is set and password based login is used, user will be prompted for it the password can also be set by using a full url for the pattern, like "sftp://user:password@myserver.com/path/to/repos/[artifact].[ext]"- Parameters:
password
- to use
-
setKeyFilePassword
public void setKeyFilePassword(java.lang.String password)
Sets the password to use for decrypting key file (if it is encrypted) if no password is set and the keyfile is encrypted, the user will be prompted for the password if the keyfile is passwordless, this parameter will be ignored if given- Parameters:
password
- to use
-
setUser
public void setUser(java.lang.String user)
sets the user to use for the ssh communication the user can also be set by using a full url for the pattern, like "ssh://user@myserver.com/path/to/repos/[artifact].[ext]"- Parameters:
user
- on the target system
-
setHost
public void setHost(java.lang.String host)
sets the host to use for the ssh communication the host can also be set by using a full url for the pattern, like "ssh://myserver.com/path/to/repos/[artifact].[ext]"- Parameters:
host
- of the target system
-
setPort
public void setPort(int port)
sets the port to use for the ssh communication port 22 is default the port can also be set by using a full url for the pattern, like "sftp://myserver.com:8022/path/to/repos/[artifact].[ext]"- Parameters:
port
- of the target system
-
setSshConfig
public void setSshConfig(java.lang.String sshConfig)
sets the path to an OpenSSH-style config file to be used for reading configuration values for an ssh repository, such as a username- Parameters:
sshConfig
- path of the config file
-
getTypeName
public abstract java.lang.String getTypeName()
- Overrides:
getTypeName
in classRepositoryResolver
-
-