public static Map<String, String> parseMapProperty(String property) {
    Map<String, String> result = new LinkedHashMap<>(); // LinkedHashMap to keep insertion order

    // Split on non-escaped commas
    List<String> entries = parseListProperty(property);
    for (String entry : entries) {
      Matcher matcher = KEY_VALUE_PATTERN.matcher(entry);
      if (!matcher.matches()) {
        throw new IllegalArgumentException("'" + entry + "' is not a valid key-value pair");
      }
      result.put(matcher.group("name"), matcher.group("value"));
    }
    return result;
  }
Parses a string in the form of "key1=value1,key2=value2,..." into a map.

@param property the map string to parse, with entries separated by "," and key-value pairs
    separated by "="
@return the map of parsed values
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ConfigurationPropertyValidator.java