Gradle Could not find method compileOnly

摘要: Git clone a new project, Gradle build and hits the following error message :

Git clone a new project, Gradle build and hits the following error message :

Terminal
$ gradle clean build
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/mkyong/Documents/workspace/hc2/web/build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':web'.
> Could not find method compileOnly() for arguments [org.springframework.boot:spring-boot-starter-tomcat] on project ':web'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED

Using Gradle 2.4

Terminal
gradle -version
------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------
Build time:   2015-05-05 08:09:24 UTC
Build number: none
Revision:     5c9c3bc20ca1c281ac7972643f1e2d190f2c943c
Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM:          1.8.0_74 (Oracle Corporation 25.74-b02)
OS:           Mac OS X 10.12.6 x86_64

Solution

The scope compileOnly has been introduced since Gradle 2.12, to fix it, just upgrade Gradle to the latest version, like Gradle 4.1 which released on Aug 07, 2017.

References

  1. Gradle blog – Introducing Compile-Only Dependencies
  2. Gradle release

上一篇: Oracle PL/SQL BITAND function example
下一篇: MongoDB Where is the log file?
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号