Reputation: 61
I am trying to use Auto DevOps on GitLab to deploy my Java 11 Spring Boot Maven project to Kubernetes. I am getting the following error:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project ABC: Fatal error compiling: invalid target release: 11 -> [Help 1]
The project builds fine locally. Does anyone know how to fix this on GitLab?
Upvotes: 3
Views: 1195
Reputation: 339
Share your pipeline and error logs so that we can get to know what you are facing the issue.
Even you can use the below pipeline to build your project, as per bit information shared by you that indicate you are facing issue while building your project with Gitlab:
Use below pipeline to build:
Java_Build:
stage: build
image:
name: docker:20.10
services:
- docker:dind
before_script:
- apk update
- apk add openjdk8
- apk add maven
script:
- mvn clean install
Upvotes: 0
Reputation: 61
According to this changelog post on Hiroku's devcenter, you have to create a file 'system.properties' on your project, with this configuration in it:
java.runtime.version=11
During the next deployment, the build phase will use OpenJDK 11.
Upvotes: 6