private void generate() throws Exception {
    File current = new File(templateFile);
    if (current.exists()) {
      ClassLoader loader = GenHiveTemplate.class.getClassLoader();
      URL url = loader.getResource("org/apache/hadoop/hive/conf/HiveConf.class");
      if (url != null) {
        File file = new File(url.getFile());
        if (file.exists() && file.lastModified() < current.lastModified()) {
          return;
        }
      }
    }
    writeToFile(current, generateTemplate());
  }
Generates hive-default.xml.template from HiveConf.ConfVars
common/src/java/org/apache/hadoop/hive/ant/GenHiveTemplate.java