0
votes

I'm setting up a simple servlet application using Quarkus. Where should I place the web.xml file and how should I deploy the application using the native build feature of Quarkus?

I have tried placing web.xml in project-name/src/main/resources/WEB-INF folder and natively built it using GraalVM docker image, but the built is not working. Dockerfile I used for the build is as of below.

Stage 1 : build with maven builder image with native capabilities

FROM quay.io/quarkus/centos-quarkus-maven:19.1.1 AS build

COPY src /usr/src/app/src

COPY pom.xml /usr/src/app

USER root

RUN chown -R quarkus /usr/src/app

USER quarkus

RUN mvn -f /usr/src/app/pom.xml -Pnative clean package

Stage 2 : create the docker final image

FROM registry.access.redhat.com/ubi8/ubi-minimal

WORKDIR /work/

COPY --from=build /usr/src/app/target/*-runner /work/application

RUN chmod 775 /work

EXPOSE 8080

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

I expected the output to be "Welcome", but the actual output is "Not Found".

1
Hi, you don't need a web.xml file in Quarkus applications. I suggest you look at the REST and native guides of Quarkus to get a better understanding of what Quarkus involvesgeoand

1 Answers

0
votes

You can place web.xml file in the project-name/src/main/resources/META-INF directory to get it working.