Repository: GoogleContainerTools/jib
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/JarProcessor.java (Java)

Code before:
  /**
   * Determines whether the jar is a spring boot or standard jar.
   *
   * @param jarPath path to the jar
   * @return the jar type
   * @throws IOException if I/O error occurs when opening the file
   */
  public static JarType determineJarType(Path jarPath) throws IOException {
    try (JarFile jarFile = new JarFile(jarPath.toFile())) {
      if (jarFile.getEntry("BOOT-INF") != null) {
        return JarType.SPRING_BOOT;
      }
      return JarType.STANDARD;
    }
  }

  /**
   * Explodes jar and create three layers for classes, resources and dependencies on container.
   *
   * @param jarPath path to jar file
   * @param tempDirPath path to temporary jib local directory
   * @return list of {@link FileEntriesLayer}
   * @throws IOException if I/O error occurs when opening the jar file or if temporary directory
   *     provided doesn't exist
   */
  protected static List<FileEntriesLayer> explodeStandardJar(Path jarPath, Path tempDirPath)
      throws IOException {
    Path localExplodedJarRoot = tempDirPath;
    ZipUtil.unzip(jarPath, localExplodedJarRoot);
    List<FileEntriesLayer> layers = new ArrayList<>();

    // Get dependencies from Class-Path in the jar's manifest and add a layer each for non-snapshot
    // and snapshot dependencies. If Class-Path is not present in the jar's manifest then skip
    // adding a dependencies layer.
    String classPath = null;
    try (JarFile jarFile = new JarFile(jarPath.toFile())) {
      classPath = jarFile.getManifest().getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
    }
    if (classPath != null) {
      Predicate<String> isSnapshot = name -> name.contains("SNAPSHOT");
      List<String> allDependencies = Splitter.onPattern("\\s+").splitToList(classPath.trim());
      List<Path> nonSnapshotDependencies =
          allDependencies
              .stream()
              .filter(isSnapshot.negate())
              .map(Paths::get)
              .collect(Collectors.toList());
      List<Path> snapshotDependencies =
          allDependencies.stream().filter(isSnapshot).map(Paths::get).collect(Collectors.toList());
      if (!nonSnapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder nonSnapshotDependenciesLayerBuilder =

Review comment (suggestion):
Perhaps this can be package-private?
```suggestion
  static List<FileEntriesLayer> explodeStandardJar(Path jarPath, Path tempDirPath)
```
And if this needs to be package-private only to be able to call from tests (i.e., it should have been `private` if not for the tests), add `@VisibleForTesting`.

Code after:
  /**
   * Determines whether the jar is a spring boot or standard jar.
   *
   * @param jarPath path to the jar
   * @return the jar type
   * @throws IOException if I/O error occurs when opening the file
   */
  public static JarType determineJarType(Path jarPath) throws IOException {
    try (JarFile jarFile = new JarFile(jarPath.toFile())) {
      if (jarFile.getEntry("BOOT-INF") != null) {
        return JarType.SPRING_BOOT;
      }
      return JarType.STANDARD;
    }
  }

  /**
   * Explodes jar and create three layers for classes, resources and dependencies on container.
   *
   * @param jarPath path to jar file
   * @param tempDirPath path to temporary jib local directory
   * @return list of {@link FileEntriesLayer}
   * @throws IOException if I/O error occurs when opening the jar file or if temporary directory
   *     provided doesn't exist
   */
  static List<FileEntriesLayer> explodeStandardJar(Path jarPath, Path tempDirPath)
      throws IOException {
    Path localExplodedJarRoot = tempDirPath;
    ZipUtil.unzip(jarPath, localExplodedJarRoot);
    List<FileEntriesLayer> layers = new ArrayList<>();

    // Get dependencies from Class-Path in the jar's manifest and add a layer each for non-snapshot
    // and snapshot dependencies. If Class-Path is not present in the jar's manifest then skip
    // adding the dependencies layers.
    String classPath = null;
    try (JarFile jarFile = new JarFile(jarPath.toFile())) {
      classPath = jarFile.getManifest().getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
    }
    if (classPath != null) {
      Predicate<String> isSnapshot = name -> name.contains("SNAPSHOT");
      List<String> allDependencies = Splitter.onPattern("\\s+").splitToList(classPath.trim());
      List<Path> nonSnapshotDependencies =
          allDependencies
              .stream()
              .filter(isSnapshot.negate())
              .map(Paths::get)
              .collect(Collectors.toList());
      List<Path> snapshotDependencies =
          allDependencies.stream().filter(isSnapshot).map(Paths::get).collect(Collectors.toList());
      if (!nonSnapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder nonSnapshotDependenciesLayerBuilder =