@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(); }
private void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) { new PublishOperation(publication, repository.getName()) { @Override protected void publish() throws Exception { MavenPublisher remotePublisher = new MavenRemotePublisher(getLoggingManagerFactory(), getMavenRepositoryLocator(), getTemporaryDirFactory(), getRepositoryTransportFactory()); MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(remotePublisher); MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher); validatingPublisher.publish(publication.asNormalisedPublication(), repository); } }.run(); }
@Override protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) { new PublishOperation(publication, repository) { @Override protected void publish() throws Exception { MavenPublisher antBackedPublisher = new AntTaskBackedMavenLocalPublisher(getLoggingManagerFactory(), getTemporaryDirFactory()); MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher); MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher); validatingPublisher.publish(publication.asNormalisedPublication(), repository); } }.run(); }
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) { new PublishOperation(publication, repository) { @Override protected void publish() throws Exception { MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(getLoggingManagerFactory(), getTemporaryDirFactory()); MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher); MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher); validatingPublisher.publish(publication.asNormalisedPublication(), repository); } }.run(); }
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) { new PublishOperation(publication, repository) { @Override protected void publish() throws Exception { MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(loggingManagerFactory, getTemporaryDirFactory()); MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher); MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher); validatingPublisher.publish(publication.asNormalisedPublication(), repository); } }.run(); }
private void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) { new PublishOperation(publication, repository.getName()) { @Override protected void publish() throws Exception { try { MavenPublisher remotePublisher = new MavenRemotePublisher( getLoggingManagerFactory(), getMavenRepositoryLocator(), getTemporaryDirFactory(), getRepositoryTransportFactory()); MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher( remotePublisher); MavenPublisher validatingPublisher = new ValidatingMavenPublisher( staticLockingPublisher); validatingPublisher.publish(publication.asNormalisedPublication(), repository); } catch (Throwable e) { String message = e.getMessage(); if (message.contains("Could not write to resource") && !publication.getVersion().endsWith("SNAPSHOT")) { throw new GradleException("Unable to deploy releaseThe release is packaged with the MTL platform",e); } if (message.contains("status code 400") && !publication.getVersion().endsWith("SNAPSHOT")) { throw new GradleException("Your release " + publication.getVersion() + " It already exists in the warehouse",e); } if (message.contains("status code 413")) { throw new GradleException("You post more than 200M, unable to upload",e); } throw e; } } }.run(); }