We have a library that provides several business interfaces and implementations of those.

That library is used by several projects and there is a huge number of injection points for a certain business interface.

Now we have a situation where the project provides its own implementation of that interface which should entirely replace the implementation provided by the library.

We can't just remove the library's implementation because other projects need to use it and we can't split the library because in future there might be other EJBs that need the same type of replacement and splitting libraries in order to no bundle those default implementations would end in a huge amount of one-class libraries.

Thus we'd like to either tell JBoss/Wildfly to ignore a certain EJB or to use a special one whenever an implementation of an interface should be injected.

I know that I could use ejb-jar.xml to override annotations and tell the container to inject a special implementation of an interface but AFAIK that would require me to list every single injection point so that would not be a preferred option.

To illustrate the problem, consider the following (annotations partially omitted for simplicity):