Repository: GoogleContainerTools/jib
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/TaskCommon.java (Java)

Code before:
/** Collection of common methods to share between Gradle tasks. */
class TaskCommon {

  public static final String VERSION_URL = "https://storage.googleapis.com/jib-versions/jib-gradle";

  static Future<Optional<String>> newUpdateChecker(
      ProjectProperties projectProperties, GlobalConfig globalConfig, Logger logger) {
    if (projectProperties.isOffline()
        || !logger.isLifecycleEnabled()
        || globalConfig.isDisableUpdateCheck()) {
      return Futures.immediateFuture(Optional.empty());
    }
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    try {
      return UpdateChecker.checkForUpdate(
          executorService,
          VERSION_URL,
          projectProperties.getToolName(),
          projectProperties.getToolVersion(),
          projectProperties::log);
    } finally {
      executorService.shutdown();
    }
  }

  @VisibleForTesting
  static void finishUpdateChecker(
      ProjectProperties projectProperties, Future<Optional<String>> updateCheckFuture) {
    UpdateChecker.finishUpdateCheck(updateCheckFuture)
        .ifPresent(
            latestVersion -> {
              String changelogUrl =
                  ProjectInfo.GITHUB_URL + "/blob/master/jib-gradle-plugin/CHANGELOG.md";
              String privacyUrl = ProjectInfo.GITHUB_URL + "/blob/master/docs/privacy.md";
              String message =
                  String.format(
                      "\n\u001B[33mA new version of %s (%s) is available (currently using %s). Update your"
                          + " build configuration to use the latest features and fixes!\n%s.\u001B[0m\n\nPlease see"
                          + " %s for info on disabling this update check.\n",
                      projectProperties.getToolName(),
                      latestVersion,
                      projectProperties.getToolVersion(),
                      changelogUrl,
                      privacyUrl);
              projectProperties.log(LogEvent.lifecycle(message));
            });
  }

  @Nullable
  static TaskProvider<Task> getWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin(WarPlugin.class)) {

Review comment (suggestion):
The method is required to be package-private, not just for testing.
```suggestion
```

Code after:
class TaskCommon {

  public static final String VERSION_URL = "https://storage.googleapis.com/jib-versions/jib-gradle";

  static Future<Optional<String>> newUpdateChecker(
      ProjectProperties projectProperties, GlobalConfig globalConfig, Logger logger) {
    if (projectProperties.isOffline()
        || !logger.isLifecycleEnabled()
        || globalConfig.isDisableUpdateCheck()) {
      return Futures.immediateFuture(Optional.empty());
    }
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    try {
      return UpdateChecker.checkForUpdate(
          executorService,
          VERSION_URL,
          projectProperties.getToolName(),
          projectProperties.getToolVersion(),
          projectProperties::log);
    } finally {
      executorService.shutdown();
    }
  }

  static void finishUpdateChecker(
      ProjectProperties projectProperties, Future<Optional<String>> updateCheckFuture) {
    UpdateChecker.finishUpdateCheck(updateCheckFuture)
        .ifPresent(
            latestVersion -> {
              String changelogUrl =
                  ProjectInfo.GITHUB_URL + "/blob/master/jib-gradle-plugin/CHANGELOG.md";
              String privacyUrl = ProjectInfo.GITHUB_URL + "/blob/master/docs/privacy.md";
              String message =
                  String.format(
                      "\n\u001B[33mA new version of %s (%s) is available (currently using %s). Update your"
                          + " build configuration to use the latest features and fixes!\n%s\u001B[0m\n\nPlease see"
                          + " %s for info on disabling this update check.\n",
                      projectProperties.getToolName(),
                      latestVersion,
                      projectProperties.getToolVersion(),
                      changelogUrl,
                      privacyUrl);
              projectProperties.log(LogEvent.lifecycle(message));
            });
  }

  @Nullable
  static TaskProvider<Task> getWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin(WarPlugin.class)) {
      return project.getTasks().named(WarPlugin.WAR_TASK_NAME);
    }