0

We have a project with couple of subprojects in the same SVN repository. For example:

svn://ip/svn/ trunk/subproject1 svn://ip/svn/ trunk/subproject2 

Is it possible in Jenkins to create conditional trigger on the build step?

I will clarify: I want to execute the Maven build step only if its SVN tree was changed.

For example, svn://ip/svn/ trunk/subproject1 tree was changed. In this case the whole build should be triggered.

Then, (since svn://ip/svn/ trunk/subproject1 tree was changed) the Maven build step for subproject1 will be executed.

But the Maven build step for subproject2 will NOT be executed, since svn://ip/svn/ trunk/subproject2 was not changed.

Any help will be appreciated!

Best regards, Michael

1 Answer 1

2

Short answer: no.

Long answer: yes, if you create separate Jenkins builds for each module, and the parent project does not attempt to be both an "aggregator" POM (containing a list of child modules) and a "parent" POM (containing definitions used by the children). This also has the benefit of properly rebuilding dependent projects.

That said, why are you concerned about rebuilding everything with Jenkins? It's usually the best approach, as it flushes out any unexpected relationships between child projects.

Sign up to request clarification or add additional context in comments.

2 Comments

Dear Parsifal, I need clarification regarding multiple builds. I need to perform the following: 1) Build subproject1 (Java). 2) Build subproject2 (C++). 3) Create installation. How can I ensure in the main build that everything is executed according to the order above? I see only the following option “Build after other projects are built”. IMO, the best options will be to allow the build step that allow to run other job. Do you know Jenkins plugin that allow to add as the build step to run other job? Thank you for your help!
On the Jenkins dashboard, you should find a "Project Relationship" link. Clicking it lets you specify upstream/downstream relationships where Jenkins cannot otherwise figure it out (if you were building everything with Maven, it would just work; if your C++ build uses another tool, you'll have to do it manually).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.