private void doPublish(final IvyPublicationInternal publication, final IvyArtifactRepository repository) {
new PublishOperation(publication, repository) {
@Override
protected void publish() throws Exception {
IvyNormalizedPublication normalizedPublication = publication.asNormalisedPublication();
IvyPublisher publisher = getIvyPublisher();
publisher.publish(normalizedPublication, Cast.cast(PublicationAwareRepository.class, repository));
}
}.run();
}