Is plugins archive directory immutably /plugins?

I know the jenkins.war has options for the exploded war and plugins:

Running from: C:\apps\jenkins-2.303.2.war
webroot: $user.home/.jenkins
Jenkins Automation Server Engine 2.303.2
Usage: java -jar jenkins.war [--option=value] [--option=value]

Options:
   --webroot  = folder where the WAR file is expanded into. Default is ${JENKINS_HOME}/war
   --pluginroot  = folder where the plugin archives are expanded into. Default is ${JENKINS_HOME}/plugins

Also configurable via system property hudson.PluginManager.workDir

But is the plugin archive directory (where the .hpi/.jpi are stored) immutably ${JENKINS_HOME}/plugins ?

If so, is there a reason this is fixed? Was it a design decision or just overlooked?

1 Like

It is fixed in the sense that there isn’t a system property that can override that directory (it’s defined in LocalPluginManager.java line 49, which is called by PluginManager.createDefault). However, PluginManager.createDefault can take a custom plugin manager class in the system property hudson.PluginManager.className, and a custom PluginManager implementation (very similar to LocalPluginManager just with a different constant) could be relatively easily used. In this way, you could change the location of the directory.

Is there a particular reason you want to change the directory location?

1 Like