Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-764

Improve build failures depending on Ant exceptions

    XMLWordPrintable

    Details

    • Sprint:
      Sprint 2

      Description

      Ant build can exit with an ExitStatusException (which we'll consider as a controlled/wanted failure), a BuildTimeoutException or a generic BuildException.

      The Maven plugin can exit with a MojoFailureException or a MojoExecutionException.
      As stated in http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html#writing-plugins-sect-failure :

      A MojoExecutionException is a fatal exception, something unrecoverable happened. You would throw a MojoExecutionException if something happens that warrants a complete stop in a build; you re trying to write to disk, but there is no space left, or you were trying to publish to a remote repository, but you can’t connect to it. Throw a MojoExecutionException if there is no chance of a build continuing; something terrible has happened and you want the build to stop and the user to see a "BUILD ERROR" message.

      A MojoFailureException is something less catastrophic, a goal can fail, but it might not be the end of the world for your Maven build. A unit test can fail, or a MD5 checksum can fail; both of these are potential problems, but you don’t want to return an exception that is going to kill the entire build. In this situation you would throw a MojoFailureException. Maven provides for different "resiliency" settings when it comes to project failure.

      AntBuildMojo should raise a MojoFailureException instead of MojoExecutionException in case of ExitStatusException.

      IntegrationTestMojo should not consider MojoFailureException caused by an ExitStatusException as a (failsafe) "failure" (like a compilation problem) but as an "error" (like a test in error). Ant it must accordingly set the result read by the VerifyMojo.
      It must also set the timeout property in case of BuildTimeoutException.

      Finally, logging the root cause (when available) is more interesting and remove useless verbosity.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified