JAVA_HOME not found Maven Docker image Jenkins pipeline

Viewed 2094

I am receiving a message that JAVA_HOME can't be found or is pointed to a JRE when running the following in a Jenkins Declarative Pipeline.

pipeline {
  agent none
  stages {
    stage('Build and Package') {
      agent {
        docker { image 'maven:3.5.2-jdk-8' }
      }
      steps {
        sh 'mvn clean verify'
      }
    }
  }
}
1 Answers
Related