2

I'm writing some microservices (fat jar) which expose some http endpoint using a router. As I like every microservice automatically expose a /doc endpoint which just fetches a /src/main/resource/doc/readme.adoc and renders that to html I created a new project doc-renderer.

It puts a /doc endpoint to the router and in its handler method it tries to access the readme.adoc and renders it to html. If I now use that bundle as dependency within my microservices and put a readme.adoc under /src/main/resources/doc/ it isn't really working as it loads the readme.adoc in the dependend bundle.

So this is the resulting jar structure

microservice.jar - /doc/ - readme.adoc - /lib/ - docRenderer.jar ( here it tries to load the readme from outside ) - /doc/ - readme.adoc

To load the resource I use: getClass().getResourceAsStream("/doc/readme.adoc")

Is there a way I can force it to always use the /doc/readme.adoc file from the outer jar?

Regards, Marco

Marco
  • 173
  • 1
  • 3
  • 9

0 Answers0