Gitlab CI/CD Error: release version 14 not supported

228 views Asked by At

I have a Micronaut application. While building CI/CD workflow, I get an error while running ./mvnw verify. Locally it works without any issue.

The same gitlab-ci.yml file works with another app using Spring Boot, but I don’t see why would it be complaining about the Java version when I’m using openjdk14 in both project.

My gitlab-ci.yml:

variables:
  MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

image: adoptopenjdk/openjdk14:alpine-slim

stages:
    - package
    - release
    - run

maven-package:
    stage: package
    script:
        - ./mvnw verify -Dmaven.repo.local=$MAVEN_USER_HOME
    artifacts:
        paths:
            - target/*.jar
        expire_in: 1 day

docker-push:
    only:
        - master
    image: docker:latest
    services:
        - docker:dind
    variables:
        REGISTRY_URL: registry.gitlab.com
        DOCKER_HOST: tcp://docker:2375
        DOCKER_DRIVER: overlay2
        IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
    stage: release
    dependencies:
        - maven-package
    before_script:
        - docker info
        - cp target/*.jar .
    script:
        - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $REGISTRY_URL
        - docker build -t $IMAGE_TAG .
        - docker push $IMAGE_TAG

docker-run:
    only:
        - master
    stage: run
    before_script:
        - apk add openssh-client
        - mkdir -p ~/.ssh
        - echo "$DEPLOY_SERVER_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
        - chmod 600 ~/.ssh/id_rsa
        - eval "$(ssh-agent -s)"
        - ssh-add ~/.ssh/id_rsa
        - ssh-keyscan -H $DEPLOYMENT_SERVER_IP >> ~/.ssh/known_hosts
    dependencies:
        - docker-push     
    script:
        - ssh root@$DEPLOYMENT_SERVER_IP "./restart"

it fails with

50653 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project dev.amatos.restcountries: Fatal error compiling: error: release version 14 not supported -> [Help 1]

Am I missing something?

0

There are 0 answers