Search in sources :

Example 1 with ValidatingMavenPublisher

use of org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher in project gradle by gradle.

the class PublishToMavenLocal method publish.

@TaskAction
public void publish() {
    final MavenPublicationInternal publication = getPublicationInternal();
    if (publication == null) {
        throw new InvalidUserDataException("The 'publication' property is required");
    }
    new PublishOperation(publication, "mavenLocal") {

        @Override
        protected void publish() throws Exception {
            MavenPublisher localPublisher = new MavenLocalPublisher(getLoggingManagerFactory(), getMavenRepositoryLocator());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(localPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), null);
        }
    }.run();
}
Also used : MavenLocalPublisher(org.gradle.api.publish.maven.internal.publisher.MavenLocalPublisher) InvalidUserDataException(org.gradle.api.InvalidUserDataException) MavenPublicationInternal(org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal) ValidatingMavenPublisher(org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher) PublishOperation(org.gradle.api.publish.internal.PublishOperation) InvalidUserDataException(org.gradle.api.InvalidUserDataException) StaticLockingMavenPublisher(org.gradle.api.publish.maven.internal.publisher.StaticLockingMavenPublisher) MavenPublisher(org.gradle.api.publish.maven.internal.publisher.MavenPublisher) StaticLockingMavenPublisher(org.gradle.api.publish.maven.internal.publisher.StaticLockingMavenPublisher) ValidatingMavenPublisher(org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 PublishOperation (org.gradle.api.publish.internal.PublishOperation)1 MavenPublicationInternal (org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal)1 MavenLocalPublisher (org.gradle.api.publish.maven.internal.publisher.MavenLocalPublisher)1 MavenPublisher (org.gradle.api.publish.maven.internal.publisher.MavenPublisher)1 StaticLockingMavenPublisher (org.gradle.api.publish.maven.internal.publisher.StaticLockingMavenPublisher)1 ValidatingMavenPublisher (org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher)1 TaskAction (org.gradle.api.tasks.TaskAction)1