How to remove the ZIP targets/archives from the 'distribution' plugin

I’m using the ‘distribution’ plugin together with the ‘ivy-publish’ plugin to publish a tar.gz file. The distribution plugin is automatically adding ${distribution.name}DistZip targets and ZIP archives. When I use gradle uploadArchives I produces and uploads the tar.gz and ZIP archive. I would like to get rid of all the ZIP archives and tasks as I don’t need both (tar.gz and ZIP). I tried with

project.tasks.findAll { it.name.contains('Zip') }.each { task ->
  logger.info("Removing ${task}")
  project.tasks.remove(task)
}

but this only removes the tasks and not the ZIP archive. How can I get rid of the ZIP archives? Thx

If you are using the ‘ivy-publish’ plugin then you shouldn’t be using the ‘uploadArchives’ task. That task is used by the old publishing mechanism.

Thanks for your reply. I’m now building the tar file using the Tar task. Together with ivy-publish and two declared artifacts inside the IvyPublication configuration this works fine.