如何将包含 JAX-RS 资源的 jar/war 与 Quarkus 集成

huangapple go评论70阅读模式
英文:

How to Integrate jar/war containing JAX-RS resource with the Quarkus

问题

我对Quarkus还不熟悉,我正在尝试的是,我有两个JAX-RS应用程序的代码库。
我希望将这两个应用程序的代码打包为单个分发包。

我希望将其打包为Quarkus应用程序。

为了更清楚,以下是相应的示例。


App1:(可以是Quarkus应用程序或仅为JAX-RS war)
包含资源-> /rest/greetings

App2:(可以是Quarkus应用程序或仅为JAX-RS war)
包含资源-> /rest/hello

App3:(将被分发的Quarkus应用程序)
包含资源-> /rest/greetings
/rest/hello

使用App1和App2作为jar或war依赖


基本上,我想为两个应用程序(也可以称为模块)维护单独的代码库,并为打包和分发的第三个应用程序。
这背后的想法是构建具有可配置模块的应用程序,例如,将来如果我有5个模块,我只想构建和交付包含3个模块的应用程序,我可以做到。
我正在使用Gradle作为构建工具。

英文:

I'm new to quarkus and what I'm trying to do is I've two JAX-RS application codebase .
I want to package code of both the app as single distribution package.

I want to package it as quarkus app.

To be more clear below is an example for the same .


App1 :(Can be Quarkus app or just JAX-RS war )
Contains Resources-> /rest/greetings

App2 :(Can be Quarkus app or just JAX-RS war )
Contains Resources-> /rest/hello

App3 :(Quarkus app which will be distributed)
Contains Resources-> /rest/greetings
/rest/hello

Uses App1 and App2 as jar or war dependancy


Basically I want to maintain separate codebase for two apps(you can say modules) and third app which is for packaging and distribution.

Idea behind this is to build app with configurable module like in future if I have 5 modules and I just want to build and deliver app with 3 module I can do it .

I'm using gradle as build tool.

答案1

得分: 0

找到了适合我的解决方案,
在我的App1和App2中添加了org.jboss.jandex插件,以便生成jandex索引,并将这两个应用程序作为依赖添加到我的App3中,这样quarkus就能够在启动时加载这些带注释的类。
有关更多信息,请参见此处

英文:

Found a solution that worked for me,
Added org.jboss.jandex plugin to my App1 and App2 so it generated jandex index and added both the app as dependency to my App3 so quarkus was able to load these annotated classes on start-up.
Doc for more info here

huangapple
  • 本文由 发表于 2020年9月11日 15:18:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63842452.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定