public String getCompileTargetVersion()

in app-maven-plugin/src/main/java/com/google/cloud/tools/maven/cloudsdk/CloudSdkMojo.java [97:122]


  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;
  }