Figure 10.26. Build results using a combination filter
Another reason to use a build filter is that there are simply too many valid combinations to run in a
reasonable time. In this case, the best solution may be to upscale your build server. The second-best
solution, on the other hand, might be to only run a subset of the combinations, possibly running the
full set of combinations on a nightly basis. You can do this by using the special index variable. If you
include the expression (index%2 == 0), for example, will ensure that only one build job in two is
actually executed.
You may also want certain builds to be executed before the others, as a sanity check. For example, you
might want to run the default (and, theoretically, the most reliable) configuration for your application
first, before continuing on to more exotic combinations. To do this, you can use the “Execute touchstone
builds first” option. Here, you enter a filter value (like the one seen above) to define the first build or
builds to be executed. You can also specify if the build should proceed only if these builds are successful,
or even if they are unsuccessful. Once these builds have completed as expected, Jenkins will proceed
with the other combinations.
10.5. Generating Your Maven Build Jobs Automatically
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.