admin管理员组

文章数量:1390410

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)

本文标签: Quarkus extension with REST resourceStack Overflow