public static ArtifactProcessor fromWar(
      Path warPath,
      CacheDirectories cacheDirectories,
      War warOptions,
      CommonContainerConfigCliOptions commonContainerConfigCliOptions)
      throws InvalidImageReferenceException {
    Optional<AbsoluteUnixPath> appRoot = warOptions.getAppRoot();
    if (!commonContainerConfigCliOptions.isJettyBaseimage() && !appRoot.isPresent()) {
      throw new IllegalArgumentException(
          "Please set the app root of the container with `--app-root` when specifying a base image that is not jetty.");
    }
    AbsoluteUnixPath chosenAppRoot = appRoot.orElse(AbsoluteUnixPath.get(DEFAULT_JETTY_APP_ROOT));
    return new StandardWarExplodedProcessor(
        warPath, cacheDirectories.getExplodedArtifactDirectory(), chosenAppRoot);
  }
Creates a {@link ArtifactProcessor} instance.

@param warPath path to the war
@param cacheDirectories the location of the relevant caches
@param warOptions war cli options
@param commonContainerConfigCliOptions common cli options shared between jar and war command
@return ArtifactProcessor
@throws InvalidImageReferenceException if base image reference is invalid
jib-cli/src/main/java/com/google/cloud/tools/jib/cli/ArtifactProcessors.java