I'm working on a SpringBoot application with Java 11 that is built using Maven.
IntelliJ imports the project without any problems, but it shows me an error that for using eg. Map.of("A", "B")
methods I need to raise the language level. Apparently IntelliJ doesn't detect the java version correctly that I'm using.
In my pom.xml I'm using the spring-boot-maven-plugin to build
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Other answers on SO (eg. IDEA: javac: source release 1.7 requires target release 1.7) tell me to set the "release" (or source/target) property for the maven-build-plugin but that is incompatible with the spring-boot-maven-plugin (ie. causes problems with dependencies etc.).
How can I make IntelliJ automatically recognize and set the Java language level to 11 without manually having to change it after every pom.xml reimport?