gradle
8.5

# publications

abstract fun publications(configure: Action<out Any>)(source)

Configures the publications of this project.

The publications container defines the outgoing publications of the project. That is, the consumable representations of things produced by building the project. An example of a publication would be an Ivy Module (i.e. `ivy.xml` and artifacts), or Maven Project (i.e. `pom.xml` and artifacts).

Actual publication implementations and the ability to create them are provided by different plugins. The “publishing” plugin itself does not provide any publication types. For example, given that the 'maven-publish' plugin provides a org.gradle.api.publish.maven.MavenPublication type, you can create a publication like:

    plugins {
        id 'maven-publish'
    }

    publishing {
      publications {
        myPublicationName(MavenPublication) {
          // Configure the publication here
        }
      }
    }

Content copied to clipboard

Please see org.gradle.api.publish.ivy.IvyPublication and org.gradle.api.publish.maven.MavenPublication for more information on publishing in these specific formats.

#### Parameters

configure

The action or closure to configure the publications with.