Jenkins tends to randomly replace config.xml configuration tags

Article ID:217709818
1 minute readKnowledge base

Issue

Jenkins tends to randomly replace config.xml configuration tags.

This behaviour can be found in any type onf configuration file: system, job, plug-in and so on.

If these files are managed by a source control system (SCM), it can cause problems because it can cause collisions with valid changes made by real people. The differences need to be resolved one way or the other.

Some examples of replacements are listed below:

  • Single quotes are converted into double ones,

  • Empty tags are added. For instance, <categories/> may be removed completely or be replaced with <categories></categories>.

Resolution

This is an expected behavior. Jenkins API allows to serialize items to XML at any moment, and some plugins use this capability to save additional data or to reformat existing ones.

It is not recommended to use a SCM to store the Jenkins configuration.

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.