【发布时间】:2019-02-07 21:44:43
【问题描述】:
我正在使用 Gradle 构建一个演示 Spring Boot 应用程序,并使用 Heroku 来托管该应用程序。我已经预装了 Gradle 4.8,所以我没有在项目目录中保留 gradlew 文件,并且应用程序在本地运行良好,但是当我使用 git push heroku master 在 heroku 上部署它时。显示以下警告的日志:
remote: -----> Installing Gradle Wrapper...
remote: WARNING: Your application does not have it's own gradlew file.
remote: We'll install one for you, but this is a deprecated feature and
remote: in the future may not be supported.
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x test
显示 Gradle 版本错误后构建失败:
remote: * What went wrong:
remote: A problem occurred evaluating root project 'xxx'.
remote: > Spring Boot plugin requires Gradle 4.0 or later. The current version is Gradle 2.0
表示它使用默认的gradle 文件并安装2.0 来部署应用程序。
现在我的问题是,如何强制 Heroku 部署过程使用预安装的 Gradle 版本,而不在项目目录中保留 gradlew 并且不安装默认弃用的 gradlew?
【问题讨论】:
标签: java spring-boot gradle heroku