Recently upgraded my code to java 17. Earlier I was using MapStruct 1.3.1 with Java 11.
So, let me tell/show you the three scenarios.
SCENARIO 1
So now after java 17 update when I run my test case (say MyTestMethod
) with the run button in IntelliJ
It throws this error -
java: Supported source version 'RELEASE_6' from annotation processor 'org.mapstruct.ap.MappingProcessor' less than -source '17'
SCENARIO 2
But if I run the same test case with this command -
mvn test -Dtest="MyTestClass#MyTestMethod"
Its a SUCCESS
SCENARIO 3
However If I change the version of MapStruct to 1.5.5.final SCENARIO 1 starts working correctly.
My questions now -
- Do I need to upgrade to 1.5.5.final, if so is there anything I should change in my code too to adhere to java 17 - mapstruct compatibility?
- Why SCENARIO 1 starts working when I change the version from 1.3.1.final to 1.5.5.final as mentioned in SCENARIO 3 ?