One of my subprojects A dependsOn another subproject B. I had been using this line to declare a dependency, and things worked just fine.
evaluationDependsOn(':B')
I just moved to Gradle 3.3. And am now getting this error
Declaring custom 'build' task when using the standard Gradle lifecycle plugins is not allowed.
The general problem is: how do I make my custom tasks hook into the predefined tasks – specifically task build and task publish. There are lots of suggestions on various forums, but none of them work for me. The most promising seemed to be (inside subproject A)
I’ve also considered that perhaps I’m trying to improperly architect my build file. Option (1) task “build” should generically build all build-like things. Option (2) “build” is only for Java build, and I should create my own top-level task (say “myBuild” that depends on Java’s “build”.
The error message implies that you are creating a task named ‘build’, which is no longer allowed if the ‘build’ task is already being supplied by the standard Gradle plugins.
Does the output point you at the offending code? For example, this:
apply plugin: 'base'
task build
tells me that the offending code is on line 2:
$ ./gradlew tasks
FAILURE: Build failed with an exception.
* Where:
Build file '/home/cdore/gradle-tests/gradle-dupbuild-test/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating root project 'gradle-confforce-test'.
> Declaring custom 'build' task when using the standard Gradle lifecycle plugins is not allowed.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED