0

Is there any way I can only build changed projects in a jenkins pipeline ?

I am using p4 plugin for jenkins and there are a couple of independent projects that I don't want to build on each stage to save time

Can maven's incremental builds help in this case ?

1 Answers1

0

Let's assume you have 3 sub-projects under project A.

  • Subproject A1
  • Subproject A2
  • Subproject A3

As per your question my understanding is, if code changes are done under A2 folder then build only sub-project A2 but not A1 and A3.

You can set up 3 Jenkins jobs for Sub-projects A1, A2 and A3. Then, set up the parent job which compromises of these 3 jobs as child jobs with Multi-job configuration.

Another option:

You can set up a single job with project A and you need to evaluate folders by using the execute commands shell. But, this is complex and not a preferred option.