Yes and no !
You're right when telling that, according to the source code of the Ant task, if the SA fails to deploy (the last else in the code) no exception is throw. But when saying "the SA fails to deploy", you must tell the difference between:
- the implementation’s execution of the task DeploymentServiceMBean.deploy(),
- and, the interaction(s) with a component during DeploymentServiceMBean.deploy()
Moreover, according to the §6.6 of JBI specifications:
The package must conform to the requirements detailed in the section on “Service Assembly Packaging”, else the deployment MUST fail (by throwing a java.lang.Exception) without attempting to deploy any of the service units contained within the assembly.
...
If all service units of the assembly fail to deploy, a failure exception MUST be thrown. If at least one service unit deployment succeeds, then any failures MUST be reported using the status return String of the DeploymentServiceMBeans’s deploy() method.
So, I see no case where we can have a deployment report where the part linked to the implementation’s execution of the task has a status FAILED because an exception is thrown by DeploymentServiceMBean.deploy(). And so, I think that the last statement else in the code is a dead code part. In doubt, I don't remove it.
I will check the container source code about the possibility to have a deployment report with a status FAILED in the part of the implementation’s execution of the task DeploymentServiceMBean.deploy().
An integration test about this problem has been added with svn#37046