| 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:
- The
MavenPublishPluginmakes it possible to createMavenPublicationinstances. - The
IvyPublishPluginmakes it possible to createIvyPublicationinstances.
See the documentation for PublishingExtension.publications() for more examples of how to create and configure publications.
| Method | Description |
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 |
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)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
}