Package: org.gradle.api.publish.maven.tasks

## [Java] Class PublishToMavenRepository

- org.gradle.api.publish.maven.tasks.PublishToMavenRepository

- Publishes a MavenPublication to a MavenArtifactRepository.

  Since:
    1.4

- - ### Constructor Summary

    Constructors
    Constructor and description
    `PublishToMavenRepository ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected void` | `doPublish(MavenPublicationInternal publication, MavenArtifactRepository repository)`
    `protected Factory<LoggingManagerInternal>` | `getLoggingManagerFactory()`
    `MavenPublication` | `getPublication()` The publication to be published.
    `MavenArtifactRepository` | `getRepository()` The repository to publish to.
    `void` | `publish()`
    `void` | `setPublication(MavenPublication publication)` Sets the publication to be published.
    `void` | `setRepository(MavenArtifactRepository repository)` Sets the repository to publish to.

- - ### Constructor Detail

    - #### public PublishToMavenRepository()

  - ### Method Detail

    - #### protected void doPublish(MavenPublicationInternal publication, MavenArtifactRepository repository)

    - #### @Inject protected Factory<LoggingManagerInternal> getLoggingManagerFactory()

    - #### public MavenPublication getPublication()

      The publication to be published.

      Returns:
        The publication to be published

    - #### public MavenArtifactRepository getRepository()

      The repository to publish to.

      Returns:
        The repository to publish to

    - #### @TaskAction public void publish()

    - #### public void setPublication(MavenPublication publication)

      Sets the publication to be published.

      Parameters:
        `publication` - The publication to be published

    - #### public void setRepository(MavenArtifactRepository repository)

      Sets the repository to publish to.

      Parameters:
        `repository` - The repository to publish to