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

Code before:
  }

  /**
   * The default app root in the image. For example, if this is set to {@code "/app"}, dependency
   * JARs will be in {@code "/app/libs"}.
   */
  public static final String DEFAULT_APP_ROOT = "/app";

  /**
   * The default webapp root in the image. For example, if this is set to {@code
   * "/jetty/webapps/ROOT"}, dependency JARs will be in {@code "/jetty/webapps/ROOT/WEB-INF/lib"}.
   *
   * @deprecated Use the string {@code "/jetty/webapps/ROOT"}.
   */
  @Deprecated public static final String DEFAULT_WEB_APP_ROOT = "/jetty/webapps/ROOT";

  /**
   * Creates a new {@link JavaContainerBuilder} that uses distroless jetty as the base image. For
   * more information on {@code gcr.io/distroless/java}, see <a
   * href="https://github.com/GoogleContainerTools/distroless">the distroless repository</a>.
   *
   * @return a new {@link JavaContainerBuilder}
   * @see <a href="https://github.com/GoogleContainerTools/distroless">The distroless repository</a>
   * @deprecated Use other {@code from()} methods with the image reference {@code
   *     gcr.io/distroless/java/jetty} and change the app root by calling {@code
   *     JavaContainerBuilder.setAppRoot("/jetty/webapps/ROOT")}.
   */
  @Deprecated
  public static JavaContainerBuilder fromDistrolessJetty() {
    try {
      return from(RegistryImage.named("gcr.io/distroless/java/jetty"))
          .setAppRoot(AbsoluteUnixPath.get(DEFAULT_WEB_APP_ROOT));
    } catch (InvalidImageReferenceException ignored) {
      throw new IllegalStateException("Unreachable");
    }
  }

  /**
   * Creates a new {@link JavaContainerBuilder} with the specified base image reference. The type of
   * base image can be specified using a prefix; see {@link Jib#from(String)} for the accepted
   * prefixes.
   *
   * @param baseImageReference the base image reference
   * @return a new {@link JavaContainerBuilder}
   * @throws InvalidImageReferenceException if {@code baseImageReference} is invalid
   */
  public static JavaContainerBuilder from(String baseImageReference)
      throws InvalidImageReferenceException {
    return new JavaContainerBuilder(Jib.from(baseImageReference));
  }


Review comment (suggestion):
```suggestion
   * @deprecated Use {@code from()} with the image reference {@code
   *     gcr.io/distroless/java/jetty} and change the app root by calling {@code
   *     JavaContainerBuilder.setAppRoot("/jetty/webapps/ROOT")}.
```

Code after:

  /**
   * The default app root in the image. For example, if this is set to {@code "/app"}, dependency
   * JARs will be in {@code "/app/libs"}.
   */
  public static final String DEFAULT_APP_ROOT = "/app";

  /**
   * The default webapp root in the image. For example, if this is set to {@code
   * "/jetty/webapps/ROOT"}, dependency JARs will be in {@code "/jetty/webapps/ROOT/WEB-INF/lib"}.
   *
   * @deprecated Use the string {@code "/jetty/webapps/ROOT"}.
   */
  @Deprecated public static final String DEFAULT_WEB_APP_ROOT = "/jetty/webapps/ROOT";

  /**
   * Creates a new {@link JavaContainerBuilder} that uses distroless jetty as the base image. For
   * more information on {@code gcr.io/distroless/java}, see <a
   * href="https://github.com/GoogleContainerTools/distroless">the distroless repository</a>.
   *
   * @return a new {@link JavaContainerBuilder}
   * @see <a href="https://github.com/GoogleContainerTools/distroless">The distroless repository</a>
   * @deprecated Use {@code from()} with the image reference {@code gcr.io/distroless/java/jetty}
   *     and change the app root by calling {@code
   *     JavaContainerBuilder.setAppRoot("/jetty/webapps/ROOT")}.
   */
  @Deprecated
  public static JavaContainerBuilder fromDistrolessJetty() {
    try {
      return from(RegistryImage.named("gcr.io/distroless/java/jetty"))
          .setAppRoot(AbsoluteUnixPath.get(DEFAULT_WEB_APP_ROOT));
    } catch (InvalidImageReferenceException ignored) {
      throw new IllegalStateException("Unreachable");
    }
  }

  /**
   * Creates a new {@link JavaContainerBuilder} with the specified base image reference. The type of
   * base image can be specified using a prefix; see {@link Jib#from(String)} for the accepted
   * prefixes.
   *
   * @param baseImageReference the base image reference
   * @return a new {@link JavaContainerBuilder}
   * @throws InvalidImageReferenceException if {@code baseImageReference} is invalid
   */
  public static JavaContainerBuilder from(String baseImageReference)
      throws InvalidImageReferenceException {
    return new JavaContainerBuilder(Jib.from(baseImageReference));
  }

  /**