Parameterize the JDK distribution

Update to use modern docker image build targets

Change-Id: I487118f3dc6e1bb79ef67cb1dba9a3bf5dc32306
diff --git a/Jenkinsfile b/Jenkinsfile
index 1145d63..2ba8d6f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,3 +1,19 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+def jdkDistro = '${jdkDistro}'
+
 node ('ubuntu16.04-basebuild-1c-2g') {
   timeout (100) {
     try {
@@ -5,6 +21,13 @@
         checkout([$class: 'RepoScm', currentBranch: true, manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest', quiet: true])
       }
       stage ('Build and Publish apps') {
+
+        // Set the JDK version
+        sh 'echo Using JDK distribution: ' + jdkDistro
+        sh 'sudo update-java-alternatives --set ' +jdkDistro
+        sh 'echo Java Version:'
+        sh 'java -version'
+
         configFileProvider([configFile(fileId: 'onoscord-apps', variable: 'MAVEN_SETTINGS')]) {
           sh 'export _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true && cd onos-apps/apps && mvn -s $MAVEN_SETTINGS -e clean deploy'
         }