public String undeploy(String artifactId) throws IOException {
    lock.lock();
    logger.debug("JarDeployer Undeploying artifactId: {}", artifactId);

    try {
      logger.debug("JarDeployer deployedJars list before remove: {}",
          Arrays.toString(deployedJars.keySet().toArray()));

      // remove the deployedJar
      DeployedJar deployedJar = deployedJars.remove(artifactId);
      if (deployedJar == null) {
        throw new IllegalArgumentException(artifactId + " not deployed");
      }
      logger.debug("JarDeployer deployedJars list after remove: {}",
          Arrays.toString(deployedJars.keySet().toArray()));
      ClassPathLoader.getLatest().unloadClassloaderForArtifact(artifactId);
      deleteAllVersionsOfJar(deployedJar.getFile().getName());
      return deployedJar.getFileCanonicalPath();
    } finally {
      lock.unlock();
    }
  }
Undeploy the jar file identified by the given artifact ID.

@param artifactId The artifact to undeploy
@return The path to the location on disk where the JAR file had been deployed
@throws IOException If there's a problem deleting the file
geode-deployment/geode-deployment-legacy/src/main/java/org/apache/geode/deployment/internal/JarDeployer.java