I've a custom task that depends on the maven-publish plugin. My custom task needs some arguments from the the command line before the maven-publish plugin should run.
For that I tried the doLast closure on my custom task however the publish task is not running.
class MyGradlePlguins implements Plugin<Project> {
@Override
void apply(Project project) {
project.getPluginManager().apply("maven-publish")
BuildAndUpload buildAndUpload = project.getTasks().create("BuildAndUpload", BuildAndUpload.class);
project.getTasks().getByName("buildAndUploadTest").doLast {
println "running publish task from the doLast clause"
project.getTasks().getByName("publish").execute() <-- doens't throw error but doesn't run either
}
}
}
what am I doing wrong?