I have a problem with a build plan in a build chain that really bothers me.
I have a simple build chain A -> B
where
- A is very fast (less than a minute) - it basically does a database retrieval from a production system. There are no way to tell if the resulting artifact will be identical to the previous result before the processing has finished. Currently the build the time scheduled.
- B is very slow (5-6 hours) - it combines the output from A plus a number of other sources into a large number of artifacts. Currently it has a snapshot dependency on A as well as a dependency on the other sources.
I would like to avoid running B unless needed - i.e. if any of the inputs to B has changed - but how do I do that?
I can fail/cancel A if it detects that the results are unchanged, but that will result in a "Snapshot dependency failure" for B, so if any other the other input sources to B does change it will not rebuild the results...
Are there any way to stop or abort the build of A so the build of B will not be triggered?
EDIT: I (might) have an idea: I could let A check in the resulting artifact in SCM - if it is different from the previous version - and let this drive the trigger of B - which already have a number of other sources in the SCM. It will not be part of the same build chain - as far as I can see - but it is the next best thing...