we've got an application (distributed as war archive) that until now worked as standalone.
Now we're adding some very specific optional functionality (configurable via application properties) that will require some remote EJB invocations.
This application will be then deployed in the main environment (where it already exists in its older version) with this optional functionality switched off while at the same time in some additional "special" environment with this functionality switched on (both environments are JBoss EAP 6.4).
To get the remote EJB operations to work we just added the jboss-ejb-client.xml file with the desired configuration (ejb-receivers, clusters) into the application and this works as we need it to (together with the appropriate app. server configuration of course).
The problem is that we'd like to be able to deploy the very same war archive to both environments - not only to the one with everything setup for remote EJB invocations, but also to the main one which intentionally lacks this configuration.
Unfortunately the addition of the jboss-ejb-client.xml file creates hard dependencies on the remote outbound connections etc referenced from there and thus the application fails to deploy unless we remove that XML file from it.
Is there any possibility to make these dependencies (that are originating from the jboss-ejb-client.xml) optional so that the application would successfully deploy even without them being satisfied? Given that the presence/absence of this single file inside the application archive is the only difference it would be much easier to produce just one application archive and deploy it both ways. Having to deal with 2 variants of that application that differ only in that one thing seems to be rather unnecessary and we'd like to avoid it if possible.