Resolution
It depends on the way you ran Jenkins.
The following links document some of the options. However, the way to learn the options that apply to your version of the product is to use the --help command line option, e.g. java -jar jenkins.war --help .
|
Traditional Platform
Running Jenkins inside Jetty Winstone container
This is the default way to run Jenkins if you installed Jenkins using system packages.
To pass command line options to Jenkins, you need to change the Jenkins service configuration file. You might require elevated privileges to be able to modify this file.
Please read the service config file carefully since they expose some of the features controlled by command line options via the simple variables, e.g., HTTP[S]_PORT
, HTTPS_KEYSTORE
, etc.
In CloudBees Core on traditional platforms - Operations Center, you can find this file under:
-
/etc/default/cloudbees-core-oc
: location for most of the Linux distributions. -
/etc/sysconfig/cloudbees-core-oc
: location for RedHat/CentOS distribution. -
C:\Program Files\CloudBeesCoreOC\jenkins.xml
: default location for Windows.
In CloudBees Core on traditional platforms - Client controller, you can find this file under:
-
/etc/default/cloudbees-core-cm
: location for most of the Linux distributions. -
/etc/sysconfig/cloudbees-core-cm
: location for RedHat/CentOS distribution. -
C:\Program Files\CloudBeesCoreCM\jenkins.xml
: default location for Windows.
In CloudBees Jenkins Distribution, you can find this file under:
-
/etc/default/cloudbees-jenkins-distribution
: location for most of the Linux distributions. -
/etc/sysconfig/cloudbees-jenkins-distribution
: location for RedHat/CentOS distribution. -
C:\Program Files\CloudBeesJenkinsDistribution\jenkins.xml
: default location for Windows.
In Jenkins LTS and in CloudBees Jenkins Platform - Client controller, you can find this file under:
-
/etc/default/jenkins
: location for most of the Linux distributions. -
/etc/sysconfig/jenkins
: location for RedHat/CentOS distribution. -
C:\Program Files\Jenkins\jenkins.xml
: default location for Windows.
In CloudBees Jenkins Platform - Operations Center, you can find this file under:
-
/etc/default/jenkins-oc
: location for most of the Linux distributions. -
/etc/sysconfig/jenkins-oc
: location for RedHat/CentOS distribution. -
C:\Program Files\JenkinsOC\jenkins.xml
: default location for Windows.
Debian / Ubuntu based Linux distributions
In your service configuration file, look for the argument JENKINS_ARGS
. It should look something like this:
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT"
Then, add the arguments:
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --pluginroot=/var/cache/$NAME/plugin --httpPort=$HTTP_PORT"
Running Jenkins in Windows as a Service
- In your service configuration file add the arguments into the
<arguments>
tag. It should look like this
<arguments>-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --pluginroot=/var/cache/jenkins/plugin</arguments>
Modern Platform
For CloudBees CI on modern cloud platforms (Kubernetes or OpenShift), see: How to add Java arguments to Jenkins on CloudBees CI Modern ?.