Quantcast

Problem with global settings for plugin not being persisted after Jenkins restart

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Problem with global settings for plugin not being persisted after Jenkins restart

da3v
I'm trying to write a plugin that relies on persisted global config values, but they are being reset every time Jenkins is restarted.

Using the HelloWorldBuilder as an example:
mvn hpi:run
Jenkins->Manage Jenkins->Configure
check the "French" checkbox under "Hello World Builder"
Click "Apply"
Click "Save"
Do a build using the plugin, and output is in French ("Bonjour, <name>")
Restart Jenkins (either via control-c, mvn hpi:run, or via the manage plugins restart button)
Do a build using the plugin, and output is in English ("Hello, <name>")

In the plugin's global config file, the checked value is still set to true
<hellopersist.HelloWorldBuilder_-DescriptorImpl>
  <helpRedirect/>
  <useFrench>true</useFrench>
</hellopersist.HelloWorldBuilder_-DescriptorImpl>

So it appears that the global config file for the plugin is not being reloaded after a restart.  Could someone point me to an example of how to address this?

Thanks,
-Dave

Loading...