【发布时间】:2020-08-21 23:30:33
【问题描述】:
我使用 bitbucket pipline 将我的应用程序部署到 heroku。我添加了 system.properties java.runtime.version=14,但对我没有帮助。
在heroku日志中:
检测到 Java 应用程序
-----> 安装 JDK 1.8... 完成
-----> 安装 Maven 3.6.2... 完成
-----> 执行 Maven
......
未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-
compile) on project *:致命错误编译:无效的目标版本:14 -> [帮助 1]
**我的 bitbucket 管道看起来:
image: maven:3.6.1
clone:
depth: full
pipelines:
default:
- step:
name: Build and test
image: maven:3
caches:
- maven
script:
- mvn -B clean verify
- step:
name: Create artifact
script:
- tar czfv application.tgz pom.xml src/
artifacts:
- application.tgz
- step:
name: Deploy to production
deployment: production
script:
- pipe: atlassian/heroku-deploy:0.1.1
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: $HEROKU_APP_NAME
ZIP_FILE: "application.tgz"
【问题讨论】:
-
JDK 1.8 无法编译 Java 14,但只能编译 Java 1.8/8。也许您可以将 Heroku 配置为使用另一个/更新版本的 JDK (14)? (我不熟悉 Heroku)
标签: java spring-boot heroku pipeline