code: public String getCompileTargetVersion() {
      // TODO: Add support for maven.compiler.release
      // maven-plugin-compiler default is 1.5
      String javaVersion = "1.5";
      if (mavenProject != null) {
        // check the maven.compiler.target property first
        String mavenCompilerTargetProperty =
            mavenProject.getProperties().getProperty("maven.compiler.target");
        if (mavenCompilerTargetProperty != null) {
          javaVersion = mavenCompilerTargetProperty;
        } else {
          Plugin compilerPlugin =
              mavenProject.getPlugin("org.apache.maven.plugins:maven-compiler-plugin");
          if (compilerPlugin != null) {
            Xpp3Dom config = (Xpp3Dom) compilerPlugin.getConfiguration();
            if (config != null) {
              Xpp3Dom domVersion = config.getChild("target");
              if (domVersion != null) {
                javaVersion = domVersion.getValue();
              }
            }
          }
        }
      }
      return javaVersion;
    }
docs: Determines the Java compiler target version by inspecting the project's maven-compiler-plugin
  configuration.
  
  @return The Java compiler target version.