I am using Mapstruct (with lombok), and Mapstruct fails when I dockerize the app after calling an endpoint which uses MapStruct to map a DTO to entity.
Caused by: java.lang.ClassNotFoundException: org.mapstruct.factory.Mappers at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
Everything works well when I run the app locally, but dockerizing the app makes Mapstruct fail.
Dockerfile:
FROM openjdk:15-alpine
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Is there something I am missing or I need to do additionally to have Impl classes in the docker? I am using palantir/gradle-docker for the gradle-docker plugin.
I am using Mapstruct (with lombok), and Mapstruct fails when I dockerize the app after calling an endpoint which uses MapStruct to map a DTO to entity.
Everything works well when I run the app locally, but dockerizing the app makes Mapstruct fail.
Dockerfile:
Dependencies and docker plugin in
build.gradle
:Is there something I am missing or I need to do additionally to have
Impl
classes in the docker? I am using palantir/gradle-docker for the gradle-docker plugin.