public boolean removeJars(String[] jarNames, String[] groups) {
    lockSharedConfiguration();
    boolean success = true;
    try {
      Region<String, Configuration> configRegion = getConfigurationRegion();
      if (groups == null) {
        groups = configRegion.keySet().toArray(new String[0]);
      }
      for (String group : groups) {
        Configuration configuration = configRegion.get(group);
        if (configuration == null) {
          break;
        }

        logger.debug("Configuration before removing deployment: " + configuration);
        Configuration configurationCopy = new Configuration(configuration);

        for (String jarName : jarNames) {
          File jar = getPathToJarOnThisLocator(group, jarName).toFile();
          if (jar.exists()) {
            try {
              FileUtils.forceDelete(jar);
              logger.debug("Successfully deleted: " + jar.getName());
              configurationCopy
                  .removeDeployments(Collections.singleton(jarName));
              logger.debug("deploymentToRemove.getKey(): " + jarName);
            } catch (IOException e) {
              logger.error(
                  "Exception occurred while attempting to delete a jar from the filesystem: {}",
                  jarName, e);
            }
          }
        }
        configRegion.put(group, configurationCopy);
        logger.debug("Configuration updated for group: " + group);
        logger.debug("Configuration after removing deployment: " + configurationCopy);
      }
    } catch (Exception e) {
      logger.info("Exception occurred while deleting the jar files", e);
      success = false;
    } finally {
      unlockSharedConfiguration();
    }
    return success;
  }
Removes the jar files from the shared configuration. used when un-deploy jars

@param jarNames Names of the jar files.
@param groups Names of the groups which had the jar file deployed.
@return true on success.
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalConfigurationPersistenceService.java