在heroku上部署toolchains.xml文件

时间:2017-08-31 18:13:03

标签: java maven heroku

我在heroku上有一个应用。 当我尝试将更改推送到heroku时,我收到此错误

remote:        [INFO] Required toolchain: jdk [ vendor='oracle' version='1.9' ]
remote:        [ERROR] No toolchain found for type jdk
remote:        [ERROR] Cannot find matching toolchain definitions for the following toolchain types:
remote:        jdk [ vendor='oracle' version='1.9' ]
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] BUILD FAILURE
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] Total time: 9.746 s
remote:        [INFO] Finished at: 2017-08-31T18:00:35Z
remote:        [INFO] Final Memory: 24M/80M
remote:        [INFO] ------------------------------------------------------------------------
remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project java-cloud-sample: Cannot find matching toolchain definitions for the following toolchain types:
remote:        [ERROR] jdk [ vendor='oracle' version='1.9' ]
remote:        [ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.
remote:        [ERROR] -> [Help 1]
remote:        [ERROR]
remote:        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote:        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote:        [ERROR]
remote:        [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote:        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
remote:
remote:  !     ERROR: Failed to build app with Maven
remote:        We're sorry this build is failing! If you can't find the issue in application code,
remote:        please submit a ticket so we can help: https://help.heroku.com/
remote:
remote:  !     Push rejected, failed to compile Java app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to java-cloud-sample.
remote:

似乎在toolchains上找不到应该用于该应用程序的heroku文件。 (由maven插件使用)。 toolchains.xml看起来像这样

<toolchains>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>1.9</version>
      <vendor>oracle</vendor>
    </provides>
    <configuration>
      <jdkHome>/usr/lib/jvm/java-9-oracle</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>1.8</version>
      <vendor>oracle</vendor>
    </provides>
    <configuration>
      <jdkHome>/usr/lib/jvm/java-8-oracle</jdkHome>
    </configuration>
  </toolchain>
</toolchains>

我还使用travis-cigithub获取代码并在那里构建正常(我使用脚本将toolchains.xml复制到其.m2文件夹中。

如何将此文件添加到heroku

0 个答案:

没有答案