@Incubating public interface IvyPublication extends Publication
IvyPublication is the representation/configuration of how Gradle should publish something in Ivy format.
ivy-publish” plugin and the default publicationivy-publish” plugin creates one IvyPublication named “ivy” in the project's
publishing.publications container. This publication is configured to publish all of the project's
visible configurations (i.e. Project.getConfigurations()).
The Ivy module identifying attributes of the publication are mapped to:
module - project.nameorganisation - project.grouprevision - project.versionstatus - project.statusThe ability to add multiple publications and finely configure publications will be added in future Gradle versions.
ivy-publish” plugin will automatically create a PublishToIvyRepository task
for each IvyPublication and IvyArtifactRepository combination in
publishing.publications and publishing.repositories respectively.
Given the following…
apply plugin: 'ivy-publish'
publishing {
repositories {
ivy { url "http://my.org/repo1" }
ivy {
name "other"
url "http://my.org/repo2"
}
}
}
The following tasks will be created automatically by the plugin:
publishIvyPublicationToIvyRepository - publishes to the first repository (repository default name is “ivy”) definedpublishIvyPublicationToOtherRepository - publishes to the second repository definedPublishToIvyRepository. Executing the task will publish the publication
to the associated repository.
publish” taskpublish” plugin (that the “ivy-publish” plugin implicitly applies) adds a lifecycle task named “publish”.
All PublishToIvyRepository tasks added by this plugin automatically become dependencies of this
lifecycle task, which means that often the most convenient way to publish your project is to just run the “publish” task.
GenerateIvyDescriptor task will be created for each IvyPublication in publishing.publications.
Each GenerateIvyTask is automatically a dependency of the respective PublishToIvyRepository task, so this task is only required for
generating the ivy.xml file without also publishing your module.
apply plugin: 'ivy-publish'
generateIvyModuleDescriptor {
destination = file('generated-ivy.xml') // Override the default file that will contain the descriptor
}
Named.Namer| Modifier and Type | Method and Description |
|---|---|
void |
descriptor(Action<? super IvyModuleDescriptor> configure)
Configures the descriptor that will be published.
|
IvyModuleDescriptor |
getDescriptor()
The module descriptor that will be published.
|
IvyModuleDescriptor getDescriptor()
void descriptor(Action<? super IvyModuleDescriptor> configure)
The descriptor XML can be modified by using the IvyModuleDescriptor.withXml(org.gradle.api.Action) method.
configure - The configuration action.