Keycloak - where to put services declaration in EAR archive imported as module?

I’m trying to add a custom SPI with external libraries. To include the external libraries I made an EAR file containing all submodules and external libraries. This also contains a custom SPI, when i load it with standalone/deployments it doesn’t load the custom SPI as noted in the docs. However when loaded as module, it doesn’t see the files in META-INF/services of the submodules and reports the following error:

Failed authentication: java.lang.RuntimeException: Unable to find factory for AuthenticatorFactory: secret-question-authenticator did you forget to declare it in a META-INF/services file?

How can I ensure that Keycloak finds the factories in the EAR?
Where do I put the services declarations.

github project

The project consists of a module A which should provide a general hash function, currently setup as custom SPI (The hash does not return a PasswordCredentialModel but an abstract class called Generic Credential Model).
And module B, an authenticator, which is dependent on the general hash function in module A. To this end I combined the projects into an EAR archive. I’ve tried putting the META-INF/services at different positions in the main file but no dice.

I saw the project example by Thomas Darimont which uses the standalone/deployments way to import.
However, it does not include any META-INF/services, this leads me to conclude there is another way to provide the factories to keycloak and my best guess would be the setup.cli in the project.
However I’m unsure if this is correct and where to find documentation on what is happening in the setup.cli file.
Any ideas?

Putting the files in the EAR module src/main/application/META-INF/services directory. It now finds them but it cannot find the provider which is mentioned in the declaration, i.e. the declaration org.keycloak.provider.Spi which states com.groupyapp.hash.GenericHashSpi cannot be found, even though it is in the submodule.

I’m getting the same error! Did you find any solution?