0

I have an ant project with over 100 modules. I cycle through all modules compile, package, and publish in one build run. However, when one ivy:publish fails (due to random connection issue), the entire build exits.

I would like the build process to continue compile/publish the remaining modules even if one module fails to publish for whatever reason.

Is there some settings in ivy:publish to prevent exiting upon error or some other way to achieve this?

thanks

Scott Chang
  • 301
  • 4
  • 11

1 Answers1

0

Since you appear to be using ANT to call multiple sub-builds, then I would submit this is a control loop problem rather that something specific to ivy. In other words you are best advised to ensure each module's build is as stand-alone as you can make them and then in your loop each module's build should succeed or fail.

You have not indicated what your main build file looks like? I would high recommend using the subant task, as this has a "failonerror" flag that will give you your desired behaviour (build will continue on if a module fails).

<subant failonerror="true">
    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
    <target name="clean"/>
    <target name="build"/>
</subant>

This should be enough to solve your problem. Any build that fails can be manually re-run. In practice this might be difficult since one module failing might cause a subsequent build to fail due to missing dependencies..... You need to judge the risks of this for yourself.


You can even further complicate your solution later, by using an embedded script to run module builds. If you have lots and lots of errors you might want to add some bespoke error handling logic.

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • yes i'm using subant `` – Scott Chang Jan 14 '16 at 00:35
  • The challenge though is as you mentioned at the end that subsequent build depends on some previous builds, so if a module fails upon compilation, then it should stop and exit the entire process. The only time i want it to proceed is if ivy publish to remote repository fails due to external issue on the remote repo's end (the part not in our dev team's control) – Scott Chang Jan 14 '16 at 00:39