Gradle 应用程序的 Heroku 部署:缺少 pom.xml

Heroku deployment of Gradle application: pom.xml missing

我在 Heroku 上有一个基于 Maven 的现有应用程序,我想将其替换为生成的基于 Gradle 的 JHipster。我采取的步骤是:

  1. 使用 JHipster
  2. 开发新的基于 Gradle 的应用程序
  3. 运行 jhipster heroku
  4. git merge heroku --strategy ours
  5. git push heroku

大部分部署成功(Node.js app detected,webpack 日志记录),但随后出现错误:

Could not find a pom.xml file! Please check that it exists and is committed to Git.

没有pom.xml是正确的,因为现在是Gradle申请。但显然,Heroku 仍然期望基于 Maven 的。这些知识存储在哪里,我该如何重置它?

已经知道了。你必须 运行 这个命令,删除 Maven 构建包:

heroku buildpacks:clear

此外,在我的例子中,我还必须设置:

heroku buildpacks:set heroku/nodejs

或者 Heroku 不知道是 运行 作为 Gradle 还是 NodeJS。基于 JHipster 的应用程序需要后者。