Repository: GoogleContainerTools/jib
File: jib-core/src/main/java/com/google/cloud/tools/jib/global/JibSystemProperties.java (Java)

Code before:
 */

package com.google.cloud.tools.jib.global;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.Range;

/** Names of system properties defined/used by Jib. */
public class JibSystemProperties {

  public static final String UPSTREAM_CLIENT = "_JIB_UPSTREAM_CLIENT";
  private static final String DISABLE_USER_AGENT = "_JIB_DISABLE_USER_AGENT";

  @VisibleForTesting public static final String HTTP_TIMEOUT = "jib.httpTimeout";

  @VisibleForTesting static final String CROSS_REPOSITORY_BLOB_MOUNTS = "jib.blobMounts";

  public static final String SEND_CREDENTIALS_OVER_HTTP = "sendCredentialsOverHttp";
  public static final String SERIALIZE = "jib.serialize";

  @VisibleForTesting public static final String SKIP_EXISTING_IMAGES = "jib.skipExistingImages";

  @VisibleForTesting
  static final String USE_WILDCARD_FOR_DEPENDENCY_CLASSPATH =
      "jib.useWildcardForDependencyClasspath";

  /**
   * Gets the HTTP connection/read timeouts for registry interactions in milliseconds. This is
   * defined by the {@code jib.httpTimeout} system property. The default value is 20000 if the
   * system property is not set, and 0 indicates an infinite timeout.
   *
   * @return the HTTP connection/read timeouts for registry interactions in milliseconds
   */
  public static int getHttpTimeout() {
    if (Integer.getInteger(HTTP_TIMEOUT) == null) {
      return 20000;
    }
    return Integer.getInteger(HTTP_TIMEOUT);
  }

  /**
   * Gets whether or not to use <em>cross-repository blob mounts</em> when uploading image layers
   * ({@code mount/from}). This is defined by the {@code jib.blobMounts} system property.
   *
   * @return {@code true} if {@code mount/from} should be used, {@code false} if not, defaulting to
   *     {@code true}
   */
  public static boolean useCrossRepositoryBlobMounts() {
    return System.getProperty(CROSS_REPOSITORY_BLOB_MOUNTS) == null
        || Boolean.getBoolean(CROSS_REPOSITORY_BLOB_MOUNTS);

Review comment (suggestion):
I realize this is a draft, but I'm not super fond of this name. I sometimes think `preserveClasspathOrder` is a decent name, but i'm not sure.

Code after:
 */

package com.google.cloud.tools.jib.global;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.common.collect.Range;

/** Names of system properties defined/used by Jib. */
public class JibSystemProperties {

  public static final String UPSTREAM_CLIENT = "_JIB_UPSTREAM_CLIENT";
  private static final String DISABLE_USER_AGENT = "_JIB_DISABLE_USER_AGENT";

  @VisibleForTesting public static final String HTTP_TIMEOUT = "jib.httpTimeout";

  @VisibleForTesting static final String CROSS_REPOSITORY_BLOB_MOUNTS = "jib.blobMounts";

  public static final String SEND_CREDENTIALS_OVER_HTTP = "sendCredentialsOverHttp";
  public static final String SERIALIZE = "jib.serialize";

  @VisibleForTesting public static final String SKIP_EXISTING_IMAGES = "jib.skipExistingImages";

  /**
   * Gets the HTTP connection/read timeouts for registry interactions in milliseconds. This is
   * defined by the {@code jib.httpTimeout} system property. The default value is 20000 if the
   * system property is not set, and 0 indicates an infinite timeout.
   *
   * @return the HTTP connection/read timeouts for registry interactions in milliseconds
   */
  public static int getHttpTimeout() {
    if (Integer.getInteger(HTTP_TIMEOUT) == null) {
      return 20000;
    }
    return Integer.getInteger(HTTP_TIMEOUT);
  }

  /**
   * Gets whether or not to use <em>cross-repository blob mounts</em> when uploading image layers
   * ({@code mount/from}). This is defined by the {@code jib.blobMounts} system property.
   *
   * @return {@code true} if {@code mount/from} should be used, {@code false} if not, defaulting to
   *     {@code true}
   */
  public static boolean useCrossRepositoryBlobMounts() {
    return System.getProperty(CROSS_REPOSITORY_BLOB_MOUNTS) == null
        || Boolean.getBoolean(CROSS_REPOSITORY_BLOB_MOUNTS);
  }

  /**
   * Gets whether or not to serialize Jib's execution. This is defined by the {@code jib.serialize}