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();