I am executing the artifactoryPublish task from within build.gradle for a certain set of sub projects (in order to avoid explicit call from the command line)
task publishAllApis() {
doLast {
project.subprojects.each { subproject ->
if (subproject.name.endsWith("api")) {
println "executing publish" + subproject.name
subproject.getTasks().getByName("artifactoryPublish").execute()
}
}
}
}
task all () {
dependsOn buildAllApis
dependsOn installAllApis
dependsOn publishAllApis
}
On running ./gradlew clean all , it calls publishAllApis and prints the below message
Putting task artifact state for task ':dataservice-plaid-api:artifactoryPublish' into context took 0.0 secs.
Executing task ':dataservice-plaid-api:artifactoryPublish' (up-to-date check took 0.0 secs) due to: Task has not declared any outputs.
but does not deploy to the artifactory. All the individual sub projects have their publishing blocks and if I execute ./gradlew clean :dataservice-api:artifactoryPublish, it publishes it but not via the custom task