@Nullable
  static TaskProvider<Task> getWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin(WarPlugin.class)) {
      return project.getTasks().named(WarPlugin.WAR_TASK_NAME);
    }
    return null;
  }
Collection of common methods to share between Gradle tasks.
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/TaskCommon.java