I seems to be a kind of a bug. After some more testing, I discovered that if I remove all wb-resources from the above file, nothing gets deployed. E.g.:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="foo_main_ejb">
</wb-module>
</project-modules>
This will cause an empty deployment for the EJB module. However, if I put only one random (but existing) entry here, all source directories will be deployed. E.g.:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="foo_main_ejb">
<wb-resource deploy-path="/" source-path="/resources"/>
</wb-module>
</project-modules>
This will also cause the previous shown /src to be deployed as well as any /test /resources /foo /bar /whatever source dirs I have in the EJB module. If I put a reference to a non existing directory in the source-path (e.g. /does_not_exist) then nothing will be deployed, so there seems to be some level of validation being done before it decides to deploy everything there is to deploy.