private static boolean containsPotentialClasspathElements(@NotNull AbstractArchiveTask archiveTask, @NotNull Project project) {
    SourceSetContainer sourceSetContainer = JavaPluginUtil.getSourceSetContainer(project);
    if (sourceSetContainer == null || sourceSetContainer.isEmpty()) {
      return true;
    }
    HashSet<File> outputFiles = new HashSet<>();
    sourceSetContainer.all(ss -> outputFiles.addAll(ss.getOutput().getFiles()));
    for (Object path : getArchiveTaskSourcePaths(archiveTask)) {
      if (isSafeToResolve(path, project) || isResolvableFileCollection(path, project)) {
        for (File f : project.files(path).getFiles()) {
          if (outputFiles.contains(f)) continue;
          if (f.isDirectory() || (f.isFile() && f.getName().endsWith(".class"))) {
            return true;
          }
        }
      }
      else {
        return true;
      }
    }
    return false;
  }
private static boolean containsPotentialClasspathElements(@NotNull AbstractArchiveTask archiveTask, @NotNull Project project)