生成失败,并显示"无效的目标版本:11"消息。
提交到 bitbucket 后,管道作业会自动启动,但失败并显示
Full Error Message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project sms-commons: Fatal error compiling: invalid target release: 11 ->
如何启用 java 11 支持?
image: maven:3.3.9
pipelines:
default:
- step:
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B verify # -B batch mode makes Maven less verbose
- mvn clean install
我希望构建成功,但在我编写时,构建作业失败了。
您需要使用较新版本的 maven 编译器插件
org.apache.maven.plugins 专家编译器插件 3.8.0
你需要一个提供java 11的mavenDocker镜像,例如maven:3-jdk-11
我使用:ehsaniara/bitbucket-util
作为Docker镜像。
例:
options:
docker: true
pipelines:
branches:
master:
- step:
name: Production Build on Master
image: ehsaniara/bitbucket-util:latest
trigger: automatic
script:
- mvn clean install
您需要支持 jdk 11 的 maven 映像,因此请更新您的"image"值,如下所示:
image: maven:3.8.3-jdk-11
pipelines:
default:
- step:
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B verify # -B batch mode makes Maven less verbose
- mvn clean install