I'm trying to develop a quarkus application with a Hexagonal architecture.
Application code is available in github
I have 4 modules; Business, Persistence, Webservice and the application is packaged in a global module where I will produce my Quarkus application.
When I launch:
mvn clean package -Pnative
and then my native image
portfolio-app/target/portfolio-app-1.0-SNAPSHOT-runner
Quarkus is not able to expose my PortfolioEndpoint which is not in the main module.
I could put my endpoint in my portfolio-app and it's work, but I don't want to break the hexagonal architecture.
Should have put all my Quarkus features in the same maven module or is it possible to split features in multiple package ?
Could you try to add an empty META-INF/beans.xml file in the module containing your endpoints?
When I tried this, none of the modules where getting indexed, so not only would JAX-RS endpoints not be picked up, but nor would any of the other annotated classes.
Yes, right now, I think only the main module will be indexed if you don't add an empty META-INF/beans.xml or the Jandex Maven plugin.
Although I guess we will have a proper solution down the line, should we be documenting those 2 solutions somewhere (I don't really know where that would be...)?
Yeah, so, the issue is that you end up with next issue: the dev mode does not support multi-module either.
That's definitely something we need to fix soon enough as most of the real life projects are multi-modules.
Thx the Jandex Maven plugin work well ! My Resource is discovered.
I don't know if there is a link with the previously issue. However I had added the jandex Maven plugin. I created a producer in my main module portfolio-app which has to instantiate beans located in others modules. It does'nt seems to be called. I added some logs which never appear Provider class