-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProcessingEnvOptionsHolder not initialized yet on reverse mapping #232
Comments
@ro0sterjam I think this is related to #133 - do you have any insight? @clehene Please provide more details |
I see the same problem when the Maven annotation processor configuration contains these elements:
The error trace when I try to map an enum is:
As far as I can see, MapStruct finds the SPI implementations, but the "fake" |
Hey folks, apologies for the late response. After digging into it, it seems that the order of the processors After doing some more research though, it seems like AnnotationProcessors really should not depend on each other, as the order is not guaranteed. That said, it seems to only be a problem on my local computer if
Maybe that would work for you as well. At the end of the day though, this is definitely too fragile. Full disclosure, my team has moved away from using this library, so if so desired, the easiest path of resolution would probably to just revert my commits. Otherwise, I can take some time to see if I'm able to fix forward. In the meantime, could you try reordering the dependency definitions and report back if that works as a work around? |
Digging in further, the classes that MapStruct surfaces for overriding do not have the My original method of having a separate AnnotationProcessor fetch these compilerArgs appears to be an anti-pattern as the processors should operate in isolation from one another. The feature to properly configure an SPI should be released with 1.6 of MapStruct so this functionality should be updated once released, as to not require the workaround. |
Having the same issue in a legacy Ant based project without dependency management (simple jar files). The workaround here looks like that: <path id="my.class.path">
<fileset dir="${libs.dir}" includes="*.jar">
<!-- workaround, see https://github.com/entur/mapstruct-spi-protobuf/issues/232#issuecomment-1291493889 -->
<exclude name="mapstruct-processor-*.jar" />
</fileset>
<fileset dir="${libs.dir}" includes="mapstruct-processor-*.jar" />
</path> |
Internal error in the mapping processor: java.lang.IllegalStateException: ProcessingEnvOptionsHolder not initialized yet.
The text was updated successfully, but these errors were encountered: