Cannot perform single test in Intellij · mapstruct/mapstruct · Discussion #3461

Using OpenJDK 17, language level is also 8 in my settings.

@filiphr Could you please check what is shown for you in the settings page File | Settings | Build, Execution, Deployment | Compiler | Java Compiler? This is the only way I can get it to work.

I have also tried to upgrading to OpenJDK 21. After a mvn clean (to make sure that there is no old compiled code left) I get strange errors (interestingly only in 60 tests), e.g:

SpringSetterMapperTest
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file 
[C:\...\mapstruct\processor\target\compilation-tests\org.mapstruct.ap.test.injectionstrategy.spring.setter.SpringSetterMapperTest\shouldHaveSetterInjection_jdk\classes\org\mapstruct\ap\test\injectionstrategy\spring\setter\CustomerRecordSpringSetterMapper.class]; 
nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: 
file [C:\...\mapstruct\processor\target\compilation-tests\org.mapstruct.ap.test.injectionstrategy.spring.setter.SpringSetterMapperTest\shouldHaveSetterInjection_jdk\classes\org\mapstruct\ap\test\injectionstrategy\spring\setter\CustomerRecordSpringSetterMapper.class]; 
nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 65

Side note, interestingly JodaConversionTest also fails, is this also the case for you @filiphr?

org.opentest4j.AssertionFailedError: 
expected: "1. Januar 2014 um 00:00:00 UTC"
 but was: "1. Januar 2014, 00:00:00 UTC"

This seems like my compile phase does not pick up Java 21.


With OpenJDK 21 I also tried to delegate my tests to maven:
grafik

However the same test failures occur. No matter if I use the bundled maven or the maven wrapper.
@filiphr How is your maven configured? Do you have a environment-wide configured maven (like, does it work in a terminal outside of IntelliJ)? For me, this is not the case on this machine.