public void realizePublishingTasks(CollectionBuilder<Task> tasks, @Path("tasks.publish") Task publishLifecycleTask, @Path("tasks.publishToMavenLocal") Task publishLocalLifecycleTask,
PublishingExtension extension) {
// Create generatePom tasks for any Maven publication
PublicationContainer publications = extension.getPublications();
for (final MavenPublicationInternal publication : publications.withType(MavenPublicationInternal.class)) {
String publicationName = publication.getName();
createGeneratePomTask(tasks, publication, publicationName);
createLocalInstallTask(tasks, publishLocalLifecycleTask, publication, publicationName);
createPublishTasksForEachMavenRepo(tasks, extension, publishLifecycleTask, publication, publicationName);