1

I have a multi-module project setup. I am able to use @RestClient based injections for interfaces that are part of the same module (and registered with the @RegisterRestClient annotation).

E.g.,

my-project
    |
    |- module-1
        src/main/java/mypackage
            RestAPIInterface.java
        src/test/java/
            @Inject @RestClient RestAPIInterface -- works
    |
    |- module-2
        src/main/java/myOtherPackage
            SomeBean.java
                @Inject @RestClient RestAPIInterface -- does not work

Do I need to enable any specific features / switches in order to get this working?

Harsha R
  • 707
  • 6
  • 12
  • Do you have a `beans.xml` in your second module, or otherwise generate a Jandex index for it? See this answer: https://stackoverflow.com/a/55513723/742081 – Ladicek Feb 23 '20 at 07:27
  • Hi Ladicek. Beans.xml files are already in place. I'm seeing this problem when running the test cases for module 2. Would you like a sample project to see this behavior? – Harsha R Feb 23 '20 at 08:20
  • Could you try with 1.3.0.Alpha2? It looks similar to some class loading issues we solved. – Guillaume Smet Feb 23 '20 at 09:07
  • @GuillaumeSmet, I tried it with the 1.3.0.Alpha2 version as well and still hitting the same problem. I have put together a simple project that show cases this problem. https://github.com/roguexz/quarkus-sample . If you can have a look at that let me know your findings, that would great! – Harsha R Feb 24 '20 at 03:36
  • I'll try and take a look tomorrow – geoand Feb 25 '20 at 19:57
  • [Harsha R](https://stackoverflow.com/users/543349/harsha-r): just add an empty **beans.xml** under module-1 **resources/META-INF**. This lets Quarkus discover all beans/classes in this module. – Meziane Jul 05 '21 at 17:11

0 Answers0