public void updateMetadata(
      @SuppressWarnings("hiding") Metadata metadata, @SuppressWarnings("rawtypes") Map entries) {
    for (Object key : entries.keySet()) {
      final Object value = entries.get(key);
      if (value != null) {
        metadata.put(key, value.toString());
      }
    }

    metadata.persist();
  }
  private boolean syncVersion(Metadata metadata) {
    boolean changed = false;

    Object apGrailsVersion = metadata.get(APP_GRAILS_VERSION);

    Artifact grailsDependency = findGrailsDependency(project);
    if (grailsDependency != null) {
      if (!grailsDependency.getVersion().equals(apGrailsVersion)) {
        metadata.put(APP_GRAILS_VERSION, grailsDependency.getVersion());
        changed = true;
      }
    } else if (grailsVersion != null && !grailsVersion.equals(apGrailsVersion)) {
      metadata.put(APP_GRAILS_VERSION, grailsVersion);
      changed = true;
    }

    if (!project.getVersion().equals(metadata.get(APP_VERSION))) {
      metadata.put(APP_VERSION, project.getVersion());
      changed = true;
    }

    return changed;
  }