PublicationContainer

API Documentation:PublicationContainer

Note: This class is incubating and may change in a future version of Gradle.

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

See the documentation for PublishingExtension.publications() for more examples of how to create and configure publications.

Properties

No properties

Script blocks

No script blocks

Methods

MethodDescription
add(name, type)
Incubating

Creates a publication with the specified name and type, adding it to the container.

add(name, type, configuration)
Incubating

Creates a publication with the specified name and type, adding it to the container and configuring it with the supplied action. A Closure can be supplied in place of an action, through type coercion.

Method details

T add(String name, Class<T> type)

Note: This method is incubating and may change in a future version of Gradle.

Creates a publication with the specified name and type, adding it to the container.

apply plugin: 'maven-publish'

publishing.publications.add('publication-name', MavenPublication)

T add(String name, Class<T> type, Action<? super T> configuration)

Note: This method is incubating and may change in a future version of Gradle.

Creates a publication with the specified name and type, adding it to the container and configuring it with the supplied action. A Closure can be supplied in place of an action, through type coercion.

apply plugin: 'ivy-publish'

publishing.publications.add('publication-name', IvyPublication) {
    // Configure the ivy publication here
}