api / org.gradle.api.publish

Package org.gradle.api.publish

Types

Publication

interface Publication : Named

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

PublicationArtifact

interface PublicationArtifact : Buildable

An artifact published as part of a Publication.

PublicationContainer

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.

PublishingExtension

interface PublishingExtension

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