How to configure OpenJDK 11 in pom file.
<properties>
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
The problem is probably in the version of Java you're using to run Maven. See the discussion here:
Unable to compile simple Java 10 / Java 11 project with Maven
If you want to make Maven recognize a target release of 10 or 11, you have to first run Maven with Java 11. Check that the Java that Maven is using is correct by doing mvn --version
.