Contributed by Evgeny Goldin
As mentioned in the previous section, the number of build jobs that your Jenkins server will host can vary. As the number of build jobs grows, it becomes harder not only to view them in Jenkins dashboard, but to configure them as well. Imagine what would it take to configure 20 to 50 Jenkins jobs one-by-one! In addition, many of those jobs may have common configuration elements, such as Maven goals or build memory settings, which results in duplicated configuration and higher maintenance overhead.
For example, if you decide to run
install instead of
mvn clean deploy for your
release jobs and switch to alternative deployment methods, such as those
provided by Artifactory
plugin, you’ll have no choice but to visit all relevant jobs and
update them manually.
Alternatively, you could take an advantage of the fact that Jenkins is a simple and straightforward tool that keeps all of its definitions in plain files on the disk. Indeed you can update the config.xml files of your jobs directly in the .jenkins/jobs directory where they are kept. While this approach will work, it is still far from ideal as it involves quite a lot of manual picking and fragile replacements in Jenkins XML files.
There is a third way to achieve the nirvana of massive job updates: generate your configuration files automatically using some sort of definition file. The Maven Jenkins Plugin does exactly that, generating config.xml files ...