Maven-publish plugin equivalent of maven plugin's uploadArchives.enabled directive

In a multi-project build with the classic maven plugin, a subproject could be excluded from publishing with ‘uploadArchives.enabled = false’. Does an equivalent convention exist for the newer maven-publish plugin?

You can disable the publishing tasks in ‘maven-publish’ the same way as you would for ‘uploadArchives’. Try:

tasks.withType(PublishToMavenRepository) {
    enabled = false

Or perhaps better you could just avoid adding any MavenPublication instances to the publications container for that subproject.