@Nullable
  static TaskProvider<Task> getBootWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin("org.springframework.boot")) {
      try {
        return project.getTasks().named("bootWar");
      } catch (UnknownTaskException ignored) { // fall through
      }
    }
    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