javagradlebuild.gradlegradle-plugingradle-release-plugin

Use a subproject task in buildTasks in Gradle Release plugin


I'm configuring Gradle Release plugin 2.6.0 and want to use buildTasks as follows (it is in the root build.gradle):

buildTasks = ['clean', 'build', 'subprojectA:artifactoryPublish', 'subprojectB:artifactoryPublish']

in order to publish two jars only.

However, Gradle can't configure the project complaining as follows:

Task with name 'subprojectA:artifactoryPublish' not found in root project 'rootProject'.

How do I do it?

Thank you very much!


Solution

  • Instead use the afterReleaseBuild task like described in the readme.

    afterReleaseBuild.dependsOn subprojectA:artifactoryPublish