Closed andref closed 6 years ago
Hi!
KumuluzEE Uber JAR packaging does not support annotation scanning in project's dependencies. It only scans application classes.
You have some options. We recommend keeping the JAX-RS classes in main application. Or you can run your application as exploded, which supports dependency scanning.
Another option is creating a JAX-RS dynamic feature class in your main application and registering resources from libraries manually.
@urbim is it just not implemented or is there a fundamental reason why it's not supported? If you point me at the right direction, I might be able to contribute a patch to add support for that.
We decided not to support it. If I recall correctly, the main reason was it slowed down our start-up times significantly.
@urbim of course! that makes sense.
I have a multimodule maven project organized such that one module is the JAX-RS application and another module is the KumuluzEE app itself. The latter depends on the former. I have pushed a very small repo to demonstrate the issue at https://github.com/andref/kumuluzee-uberjar-bug.
The app runs fine from any IDE or from the command line:
During the start-up process, it notes:
The app responds as expected:
Now, if I run the uberjar generated by the kumuluzee-maven-plugin, things go wrong. The app notes:
And although it appears to be running, it does not respond:
As there's nothing really weird about packaging the JAX-RS resources and application in a jar (since the equivalent war webapp would run just fine), I believe this must be a bug in either the maven plugin or the class loading mechanism used by the uberjar.