I noticed that other scripts from some open source projects failed with the same error: “Could not find method providedCompile()…”. I thought it was an incompatibility with the version of gradle I was using, but then I discovered that “gradle init” from the same version of gradle is creating the same code.
Here’s what I tried:
$ hg clone https://bitbucket.org/sdorra/scm-manager
$ cd scm-manager
$ gradle init
:wrapper
:init
Maven to Gradle conversion is an incubating feature.
BUILD SUCCESSFUL
Total time: 4.035 secs
$
$ gradle build
FAILURE: Build failed with an exception.
* Where:
Build file 'E:\scm-manager\scm-core\build.gradle' line: 21
* What went wrong:
A problem occurred evaluating project ':scm-core'.
> Could not find method providedCompile() for arguments [project ':scm-annotation-processor'] on project ':scm-core'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.567 secs
$
$ gradle --version
------------------------------------------------------------
Gradle 2.13
------------------------------------------------------------
Build time: 2016-04-25 04:10:10 UTC
Build number: none
Revision: 3b427b1481e46232107303c90be7b05079b05b1c
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_72 (Oracle Corporation 25.72-b15)
OS: Windows 7 6.1 amd64