最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Quarkus extension with REST resource - Stack Overflow

programmeradmin0浏览0评论

Trying to get a very basic extension working that adds a REST resource, but the endpoint doesn't show up. The resource:

@Path("/kwark")
public class KwarkResource {

  @GET
  public String hello() {
    return "Hello kwark";
  }
}

and the deployment processor:

  @BuildStep
  public FeatureBuildItem feature() {
    return new FeatureBuildItem("kwark");
  }

  @BuildStep
  public AdditionalBeanBuildItem additionalBeanBuildItem() {
    return AdditionalBeanBuildItem.builder()
        .addBeanClass(KwarkResource.class)
        .setDefaultScope(DotNames.APPLICATION_SCOPED)
        .setUnremovable()
        .build();
  }

Only when I add an empty beans.xml to META-INF the endpoint shows up, but that defeats the idea of the buildsteps. (right?) What am I missing?

(full code here)

发布评论

评论列表(0)

  1. 暂无评论