简体   繁体   English

类未实现带有GraalVM本机图像的Quarkus项目的org.graalvm.nativeimage.hosted.Feature错误

[英]Class does not implement org.graalvm.nativeimage.hosted.Feature error of Quarkus project with GraalVM native-image

I'm trying to compile sample Quarkus project to native image using GraalVM and Maven. 我正在尝试使用GraalVM和Maven将示例Quarkus项目编译为本地图像。 Here is the code of my Quarkus service: 这是我的Quarkus服务的代码:

package gk.testquarkus;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "hello";
    }
}

When I compile it as usual java app with mvn package all goes well. 当我像平常一样使用mvn package编译Java应用程序时,一切运行良好。 But whe I try to compile it to the native image with mvn package -Pnative I get such error: 但是当我尝试使用mvn package -Pnative将其编译为本机映像时,出现以下错误:

Error: Class does not implement org.graalvm.nativeimage.hosted.Feature: io.quarkus.runner.AutoFeature 错误:该类未实现org.graalvm.nativeimage.hosted.Feature:io.quarkus.runner.AutoFeature

What's the reason and how can I fix that? 是什么原因,我该如何解决? I use GraalVM 19.1.1 and Quarkus 0.13.1. 我使用GraalVM 19.1.1和Quarkus 0.13.1。

您需要升级到Quarkus 0.20.0: changelog说它可以与GraalVM 19.1.1一起使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM