Mapstruct: JAVA 11 mapstruct-processor throws

Created on 15 Oct 2019  路  1Comment  路  Source: mapstruct/mapstruct

  • [ ] Is this an issue (and hence not a question)?
    Probably not.

In JDK11, the Mapping processor can't locate the javax.xml.* 3rd party packages for which i have specified for my project in Gradle file. As we know, javax.xml.* has been removed from JAVA 11, so i specified the dependencies in the Gradle project file. However, look like mapping processor plugin also depends on javax.xml.* and can't find it during it processing of the mapping. My question is how to specify the classpath for the mapstruct-processor in Gradle ? Thanks so much.

Stack trace thrown is as below.

error: Internal error in the mapping processor: java.lang.           NoClassDefFoundError: javax/xml/bind/JAXBElement
 at org.mapstruct.ap.internal.model.source.builtin.JaxbElemToValue.<init>(JaxbElemToValue.java:41)
 at org.mapstruct.ap.internal.model.source.builtin.BuiltInMappingMethods.<init>(BuiltInMappingMethods.java:49)
 at org.mapstruct.ap.internal.processor.creation.MappingResolverImpl.<init>(MappingResolverImpl.java:99)
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:98)
 at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:76)
 at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:270) 

Most helpful comment

Ok, upgrading to 1.3.1 for the processor resolves the problem. Close this question.

>All comments

Ok, upgrading to 1.3.1 for the processor resolves the problem. Close this question.

Was this page helpful?
0 / 5 - 0 ratings