api / org.gradle.api.publish

Package org.gradle.api.publish



interface Publication : Named

A publication is a description of a consumable representation of one or more artifacts, and possibly associated metadata.


interface PublicationArtifact : Buildable

An artifact published as part of a Publication.


interface PublicationContainer : ExtensiblePolymorphicDomainObjectContainer<Publication>

A PublicationContainer is responsible for creating and managing Publication instances. The set of available publication types is dependent on the application of particular plugins:

  • The org.gradle.api.publish.maven.plugins.MavenPublishPlugin makes it possible to create org.gradle.api.publish.maven.MavenPublication instances.
  • The org.gradle.api.publish.ivy.plugins.IvyPublishPlugin makes it possible to create org.gradle.api.publish.ivy.IvyPublication instances.
 apply plugin: 'ivy-publish' publishing.publications.create('publication-name', IvyPublication) { // Configure the ivy publication here } 
The usual way to add publications is via a configuration block. See the documentation for PublishingExtension#publications(org.gradle.api.Action) for examples of how to create and configure publications.


interface PublishingExtension

The configuration of how to “publish” the different components of a project.