Search code examples
javaquarkusgraalvmgraalvm-native-image

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. Here is the code of my Quarkus service:

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. But whe I try to compile it to the native image with mvn package -Pnative I get such error:

Error: Class does not implement 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.


Solution

  • You need to upgrade to Quarkus 0.20.0: changelog saying it works with GraalVM 19.1.1.