Maven build scenarios with 'Invalid target release: 11' when using JDK 17 in a Spring Boot project
I'm wondering if anyone has experience with I'm confused about Quick question that's been bugging me - I've been banging my head against this for hours... I'm working with an scenario where my Maven build fails with the behavior message `Invalid target release: 11` when I try to build my Spring Boot application with JDK 17. I have specified Java 11 as the target in my `pom.xml`, but it seems that Maven is not recognizing my JDK version correctly. My `pom.xml` contains the following configuration: ```xml <properties> <java.version>11</java.version> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> </configuration> </plugin> </plugins> </build> ``` I've tried cleaning my project with `mvn clean` and updating the dependencies with `mvn dependency:resolve`, but that hasn't resolved the scenario. My environment is set up to use JDK 17, and I've confirmed this by running `java -version`, which outputs: ```bash java version "17.0.1" 2021-10-19" Java(TM) SE Runtime Environment (build 17.0.1+12) Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12, mixed mode, sharing) ``` I've also checked that my `JAVA_HOME` is properly set to the JDK 17 installation directory. After some research, I found that Maven can sometimes default to an older JDK if multiple versions are installed, but I am not running into that scenario. Running `mvn -v` gives: ```bash Apache Maven 3.8.4 Maven home: /opt/maven Java version: 17.0.1, vendor: Oracle Corporation, runtime: /opt/java/jdk-17.0.1 ``` I'm puzzled why the build process insists on targeting Java 11 while I have explicitly set the target version. Are there any hidden properties in Maven or other configurations that I might be missing? How can I troubleshoot or fix this scenario? My development environment is Linux. This is part of a larger web app I'm building. I'm coming from a different tech stack and learning Java. I appreciate any insights!