File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed
Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 1- JDK Parameter Choice Plugin
2- ==================================
1+ # JDK Parameter Plugin
32
4- The JDK Parameter Choice Plugin allows you to set a specific JDK to be used with a job at the start of each build.
3+ Adds a build parameter that allows selecting a configured JDK installation for each build.
4+
5+ ## Description
6+
7+ This plugin adds a build parameter that allows setting which JDK should be used for a job on a per-build basis.
8+
9+ The JDKs available for selection can be configured on the job configuration page when the JDK parameter is enabled.
10+
11+ ## Configuration
12+
13+ 1 . Go to ** Manage Jenkins → Global Tool Configuration**
14+ 2 . Configure one or more JDK installations
15+ 3 . Save the configuration
16+
17+ To use in a job:
18+
19+ 1 . Open the job configuration page
20+ 2 . Enable ** This build is parameterized**
21+ 3 . Add parameter → Select ** JDK Parameter**
22+ 4 . Choose the default JDK and allowed JDK selections
23+
24+ ## Usage
25+
26+ On the build parameters page, a dropdown list allows selecting which configured JDK should be used for that build.
27+
28+ ## Pipeline Usage Example
29+
30+ ``` groovy
31+ pipeline {
32+ agent any
33+ parameters {
34+ jdk(name: 'JDK17')
35+ }
36+ stages {
37+ stage('Check Java Version') {
38+ steps {
39+ sh 'java -version'
40+ }
41+ }
42+ }
43+ }
Original file line number Diff line number Diff line change 1313 <version >1.4-SNAPSHOT</version >
1414 <name >JDK Parameter Plugin</name >
1515 <packaging >hpi</packaging >
16- <url >https://wiki.jenkins-ci.org/display/JENKINS/JDK+Parameter+Plugin </url >
16+ <url >https://github.com/jenkinsci/JDK_Parameter_Plugin-plugin </url >
1717
1818 <licenses >
1919 <license >
You can’t perform that action at this time.
0 commit comments