Description
As seen in BSP-439, if the text "BUILD SUCCESSFUL" appears in the last 100 lines of a build that ultimately fails and produces a "BUILD FAILED" message, Bamboo's Ant and Maven builder misinterpret this as a successful build.
To address this issue, these builders should also search for "BUILD FAILED" messages as well, and act on the last message found in the build log.
As a workaround, you can control the number of lines that Bamboo searches for a "BUILD SUCCESSFUL" message, by setting an environment variable named "SUCCESS_MESSAGE_LINES" before starting Bamboo. You can disable this search completely, relying solely on the return code of your build, by setting this environment variable to 0.