I've recently taken over the deploy-plugin and bundled a new version. One of the commits that was included in the new version added a new variable called path which should later be used as an additional configuration option to overwrite the default context path. Here's the commit:
The problem is that this caused a breaking change for users using the new plugin with their existing freestyle jobs:
The problem is that the job config is not automatically updated and the following builds do not have the new variable populated with the default value but are instead null.
Not updated config which causes the failure:
<publishers>
<hudson.plugins.deploy.DeployPublisher plugin="dep...@1.13">
<adapters>
<hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
<credentialsId>tomcat-credentials</credentialsId>
<url>
https://tomcat.internal.com:8120</url>
</hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
</adapters>
<contextPath></contextPath>
<war>target/*.war</war>
<onFailure>false</onFailure>
</hudson.plugins.deploy.DeployPublisher>
</publishers>
The only way to fix this seems to be to force an update of the job config by simply clicking Configure->Save. This updates the job config and everything works smoothly (see the additional path element):
<publishers>
<hudson.plugins.deploy.DeployPublisher plugin="dep...@1.14">
<adapters>
<hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
<credentialsId>tomcat-credentials</credentialsId>
<url>
https://tomcat.internal.com:8120</url>
<path>/manager/text</path>
</hudson.plugins.deploy.tomcat.Tomcat7xAdapter>
</adapters>
<war>target/*.war</war>
<onFailure>false</onFailure>
</hudson.plugins.deploy.DeployPublisher>
</publishers>
So my question is: Can this sort of problem be avoided/fixed? What is the proposed way to introduce new plugin variables with default values without breaking the job builds?