org.gradle.api.artifacts.maven
Interface MavenDeployer

All Superinterfaces:
org.apache.ivy.plugins.resolver.DependencyResolver, MavenResolver, PomFilterContainer
All Known Subinterfaces:
GroovyMavenDeployer

public interface MavenDeployer
extends MavenResolver

A resolver that can only be used for uploading artifacts to a Maven repository. If you use this resolver for getting dependencies from a Maven repository, an exception is thrown. This resolver support all aspects of Maven deployment, including snapshot deployment and metadata.xml manipulation.

You have to specify at least one repository. Otherwise, if there is only one artifact, usually there is not more to do. If there is more than one artifact you have to decide what to do about this, as a Maven pom can only deal with one artifact. There are two strategies. If you want to deploy only one artifact you have to specify a filter to select this artifact. If you want to deploy more than one artifact, you have to specify filters which select each artifact. Associated with each filter is a separate configurable pom.

You can create an instance of this type via the Upload.getRepositories() container


Field Summary
 
Fields inherited from interface org.gradle.api.artifacts.maven.PomFilterContainer
DEFAULT_ARTIFACT_POM_NAME
 
Method Summary
 void addProtocolProviderJars(Collection<File> jars)
          Out of the box only uploading to the filesysten and via http is supported.
 org.apache.maven.artifact.ant.RemoteRepository getRepository()
          Returns the repository o be used for uploading artifacts.
 org.apache.maven.artifact.ant.RemoteRepository getSnapshotRepository()
          Returns the repository o be used for uploading snapshot artifacts.
 boolean isUniqueVersion()
          Returns whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time.
 void setRepository(org.apache.maven.artifact.ant.RemoteRepository repository)
          Sets the repository to be used for uploading artifacts.
 void setSnapshotRepository(org.apache.maven.artifact.ant.RemoteRepository snapshotRepository)
          Sets the repository to be used for uploading snapshot artifacts.
 void setUniqueVersion(boolean uniqueVersion)
          Sets whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time.
 
Methods inherited from interface org.gradle.api.artifacts.maven.MavenResolver
getSettings
 
Methods inherited from interface org.apache.ivy.plugins.resolver.DependencyResolver
abortPublishTransaction, beginPublishTransaction, commitPublishTransaction, download, download, dumpSettings, exists, findIvyFileRef, getDependency, getName, getNamespace, getRepositoryCacheManager, listModules, listOrganisations, listRevisions, listTokenValues, listTokenValues, locate, publish, reportFailure, reportFailure, setName, setSettings
 
Methods inherited from interface org.gradle.api.artifacts.maven.PomFilterContainer
addFilter, filter, getActivePomFilters, getFilter, getPom, pom, setFilter, setPom
 

Method Detail

getRepository

org.apache.maven.artifact.ant.RemoteRepository getRepository()
Returns the repository o be used for uploading artifacts.

See Also:
setRepository(org.apache.maven.artifact.ant.RemoteRepository)

setRepository

void setRepository(org.apache.maven.artifact.ant.RemoteRepository repository)
Sets the repository to be used for uploading artifacts. If getRepository() is not set, this repository is also used for uploading snapshot artifacts.

Parameters:
repository - The repository to be used

getSnapshotRepository

org.apache.maven.artifact.ant.RemoteRepository getSnapshotRepository()
Returns the repository o be used for uploading snapshot artifacts.

See Also:
setSnapshotRepository(org.apache.maven.artifact.ant.RemoteRepository)

setSnapshotRepository

void setSnapshotRepository(org.apache.maven.artifact.ant.RemoteRepository snapshotRepository)
Sets the repository to be used for uploading snapshot artifacts. If this is not set, the getRepository() is used for uploading snapshot artifacts.

Parameters:
snapshotRepository - The repository to be used

addProtocolProviderJars

void addProtocolProviderJars(Collection<File> jars)
Out of the box only uploading to the filesysten and via http is supported. If other protocolls should be used, the appropriate Maven wagon jars have to be passed via this method.

Parameters:
jars -

isUniqueVersion

boolean isUniqueVersion()
Returns whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time. Defaults to true.


setUniqueVersion

void setUniqueVersion(boolean uniqueVersion)
Sets whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time. Defaults to true.