// Path: heroku-deploy/src/main/java/com/heroku/sdk/deploy/Constants.java
// public class Constants {
//     public static final String DEFAULT_WEBAPP_RUNNER_VERSION = "9.0.30.0";
// }
// 
// Path: heroku-deploy/src/main/java/com/heroku/sdk/deploy/util/PathUtils.java
// public class PathUtils {
// 
//     public static List<Path> normalizeAll(Path basePath, List<Path> paths) {
//         List<Path> normalizedPaths = new ArrayList<>();
//         for (Path path : paths) {
//             normalize(basePath, path).ifPresent(normalizedPaths::add);
//         }
// 
//         return normalizedPaths;
//     }
// 
//     public static Optional<Path> normalize(Path basePath, Path path) {
//         Path absoluteBasePath = basePath.toAbsolutePath();
//         Path normalizedAbsolutePath = absoluteBasePath.resolve(path).normalize();
// 
//         if (normalizedAbsolutePath.startsWith(absoluteBasePath)) {
//             return Optional.of(absoluteBasePath.relativize(normalizedAbsolutePath));
//         }
// 
//         return Optional.empty();
//     }
// 
//     public static boolean isValidPath(Path basePath, Path path) {
//         return normalize(basePath, path).isPresent();
//     }
// 
//     public static List<Path> expandDirectories(Path basePath, List<Path> paths) throws IOException {
//         ArrayList<Path> result = new ArrayList<>();
//         for (Path path : paths) {
//             result.addAll(expandDirectory(basePath, path));
//         }
// 
//         return result;
//     }
// 
//     public static List<Path> expandDirectory(Path basePath, Path path) throws IOException {
//         return Files
//                 .walk(basePath.resolve(path).normalize())
//                 .filter(subPath -> !Files.isDirectory(subPath))
//                 .map(subPath -> normalize(basePath, subPath))
//                 .filter(Optional::isPresent)
//                 .map(Optional::get)
//                 .collect(Collectors.toList());
//     }
// 
//     public static String separatorsToUnix(Path path) {
//         // Path will normalize separators back to Windows when run on Windows. We have to fall back to a String here.
//         return path.toString().replace('\\', '/');
//     }
// }


import com.heroku.sdk.deploy.Constants;
import com.heroku.sdk.deploy.util.PathUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
package com.heroku.sdk.maven.mojo;



public abstract class AbstractHerokuMojo extends AbstractMojo {

  @Parameter(defaultValue="${session}", readonly=true)
  protected MavenSession mavenSession;

  @Parameter(defaultValue="${project}", readonly=true)
  protected MavenProject mavenProject;

  @Component
  protected BuildPluginManager pluginManager;

  /**
   * The name of the Heroku app.
   */
  @Parameter(name="appName", property="heroku.appName")
  protected String appName = null;

  /**
   * The version of the JDK Heroku with run the app with.
   */
  @Parameter(name="jdkVersion", property="heroku.jdkVersion")
  protected String jdkVersion = null;

  /**
   * Configuration variables that will be set on the Heroku app.
   */
  @Parameter(name="configVars")
  protected Map<String, String> configVars = Collections.emptyMap();

  /**
   * A set of file patterns to include.
   */
  @Parameter(name="includes")
  protected List<String> includes = new ArrayList<>();

  /**
   * If the target directory should also be included. Defaults to true.
   */
  @Parameter(name="includeTarget", defaultValue = "true")
  protected boolean includeTarget = true;

  /**
   * If upload progress should be logged to debug.
   */
  @Parameter(name="logProgress", defaultValue = "false")
  protected boolean logProgress = false;

  /**
   * The buildpacks to run against the partial build.
   */
  @Parameter(name="buildpacks")
  protected List<String> buildpacks = new ArrayList<>();

  /**
   * The process types used to run on Heroku (similar to Procfile).
   */
  @Parameter(name="processTypes")
  protected Map<String, String> processTypes = Collections.emptyMap();

  /**
   * The path to the war file that will be deployed with the `deploy-war` target.
   */
  @Parameter(name="warFile")
  protected String warFile = null;

  /**
   * The version of webapp-runner to use.
   */
  @Parameter(name="webappRunnerVersion")
// Path: heroku-deploy/src/main/java/com/heroku/sdk/deploy/Constants.java
// public class Constants {
//     public static final String DEFAULT_WEBAPP_RUNNER_VERSION = "9.0.30.0";
// }
// 
// Path: heroku-deploy/src/main/java/com/heroku/sdk/deploy/util/PathUtils.java
// public class PathUtils {
// 
//     public static List<Path> normalizeAll(Path basePath, List<Path> paths) {
//         List<Path> normalizedPaths = new ArrayList<>();
//         for (Path path : paths) {
//             normalize(basePath, path).ifPresent(normalizedPaths::add);
//         }
// 
//         return normalizedPaths;
//     }
// 
//     public static Optional<Path> normalize(Path basePath, Path path) {
//         Path absoluteBasePath = basePath.toAbsolutePath();
//         Path normalizedAbsolutePath = absoluteBasePath.resolve(path).normalize();
// 
//         if (normalizedAbsolutePath.startsWith(absoluteBasePath)) {
//             return Optional.of(absoluteBasePath.relativize(normalizedAbsolutePath));
//         }
// 
//         return Optional.empty();
//     }
// 
//     public static boolean isValidPath(Path basePath, Path path) {
//         return normalize(basePath, path).isPresent();
//     }
// 
//     public static List<Path> expandDirectories(Path basePath, List<Path> paths) throws IOException {
//         ArrayList<Path> result = new ArrayList<>();
//         for (Path path : paths) {
//             result.addAll(expandDirectory(basePath, path));
//         }
// 
//         return result;
//     }
// 
//     public static List<Path> expandDirectory(Path basePath, Path path) throws IOException {
//         return Files
//                 .walk(basePath.resolve(path).normalize())
//                 .filter(subPath -> !Files.isDirectory(subPath))
//                 .map(subPath -> normalize(basePath, subPath))
//                 .filter(Optional::isPresent)
//                 .map(Optional::get)
//                 .collect(Collectors.toList());
//     }
// 
//     public static String separatorsToUnix(Path path) {
//         // Path will normalize separators back to Windows when run on Windows. We have to fall back to a String here.
//         return path.toString().replace('\\', '/');
//     }
// }


// Path: heroku-maven-plugin/src/main/java/com/heroku/sdk/maven/mojo/AbstractHerokuMojo.java
import com.heroku.sdk.deploy.Constants;
import com.heroku.sdk.deploy.util.PathUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;

package com.heroku.sdk.maven.mojo;



public abstract class AbstractHerokuMojo extends AbstractMojo {

  @Parameter(defaultValue="${session}", readonly=true)
  protected MavenSession mavenSession;

  @Parameter(defaultValue="${project}", readonly=true)
  protected MavenProject mavenProject;

  @Component
  protected BuildPluginManager pluginManager;

  /**
   * The name of the Heroku app.
   */
  @Parameter(name="appName", property="heroku.appName")
  protected String appName = null;

  /**
   * The version of the JDK Heroku with run the app with.
   */
  @Parameter(name="jdkVersion", property="heroku.jdkVersion")
  protected String jdkVersion = null;

  /**
   * Configuration variables that will be set on the Heroku app.
   */
  @Parameter(name="configVars")
  protected Map<String, String> configVars = Collections.emptyMap();

  /**
   * A set of file patterns to include.
   */
  @Parameter(name="includes")
  protected List<String> includes = new ArrayList<>();

  /**
   * If the target directory should also be included. Defaults to true.
   */
  @Parameter(name="includeTarget", defaultValue = "true")
  protected boolean includeTarget = true;

  /**
   * If upload progress should be logged to debug.
   */
  @Parameter(name="logProgress", defaultValue = "false")
  protected boolean logProgress = false;

  /**
   * The buildpacks to run against the partial build.
   */
  @Parameter(name="buildpacks")
  protected List<String> buildpacks = new ArrayList<>();

  /**
   * The process types used to run on Heroku (similar to Procfile).
   */
  @Parameter(name="processTypes")
  protected Map<String, String> processTypes = Collections.emptyMap();

  /**
   * The path to the war file that will be deployed with the `deploy-war` target.
   */
  @Parameter(name="warFile")
  protected String warFile = null;

  /**
   * The version of webapp-runner to use.
   */
  @Parameter(name="webappRunnerVersion")
  protected String webappRunnerVersion = Constants.DEFAULT_WEBAPP_RUNNER_VERSION;