// Path: heroku-maven-plugin/src/main/java/com/heroku/sdk/maven/MojoExecutor.java
// public class MojoExecutor {
//     public static void copyDependenciesToBuildDirectory(MavenProject mavenProject,
//                                                         MavenSession mavenSession,
//                                                         BuildPluginManager pluginManager) throws MojoExecutionException {
//         executeMojo(
//                 plugin(
//                         groupId("org.apache.maven.plugins"),
//                         artifactId("maven-dependency-plugin"),
//                         version("2.4")
//                 ),
//                 goal("copy-dependencies"),
//                 configuration(
//                         element(name("outputDirectory"), "${project.build.directory}/dependency")
//                 ),
//                 executionEnvironment(
//                         mavenProject,
//                         mavenSession,
//                         pluginManager
//                 )
//         );
//     }
// 
//     public static Path createDependencyListFile(MavenProject mavenProject,
//                                                 MavenSession mavenSession,
//                                                 BuildPluginManager pluginManager) throws MojoExecutionException, IOException {
// 
//         Path path = Files.createTempFile("heroku-maven-plugin", "mvn-dependency-list.log");
// 
//         executeMojo(
//                 plugin(
//                         groupId("org.apache.maven.plugins"),
//                         artifactId("maven-dependency-plugin"),
//                         version("2.4")
//                 ),
//                 goal("list"),
//                 configuration(
//                         element(name("outputFile"), path.toString())
//                 ),
//                 executionEnvironment(
//                         mavenProject,
//                         mavenSession,
//                         pluginManager
//                 )
//         );
// 
//         return path;
//     }
// }


import com.heroku.sdk.maven.MojoExecutor;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
package com.heroku.sdk.maven.mojo;


/**
 * Deploys an application to Heroku.
 */
@Mojo(name="deploy", requiresDependencyResolution = ResolutionScope.RUNTIME)
@Execute(phase = LifecyclePhase.PACKAGE)
public class DeployMojo extends AbstractHerokuDeployMojo {

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    /* We vendor all dependencies into the build directory before deploying to ensure those are copied to the source
     * blob as well. This avoids that users have to explicitly copy dependencies to /target and is helpful in cases
     * where the user does not have deep knowledge about the Maven build process and/or did not configure many of the
     * plugins parameters.
     *
     * Advanced users should use DeployOnlyMojo which does not copy the dependencies.
     */
// Path: heroku-maven-plugin/src/main/java/com/heroku/sdk/maven/MojoExecutor.java
// public class MojoExecutor {
//     public static void copyDependenciesToBuildDirectory(MavenProject mavenProject,
//                                                         MavenSession mavenSession,
//                                                         BuildPluginManager pluginManager) throws MojoExecutionException {
//         executeMojo(
//                 plugin(
//                         groupId("org.apache.maven.plugins"),
//                         artifactId("maven-dependency-plugin"),
//                         version("2.4")
//                 ),
//                 goal("copy-dependencies"),
//                 configuration(
//                         element(name("outputDirectory"), "${project.build.directory}/dependency")
//                 ),
//                 executionEnvironment(
//                         mavenProject,
//                         mavenSession,
//                         pluginManager
//                 )
//         );
//     }
// 
//     public static Path createDependencyListFile(MavenProject mavenProject,
//                                                 MavenSession mavenSession,
//                                                 BuildPluginManager pluginManager) throws MojoExecutionException, IOException {
// 
//         Path path = Files.createTempFile("heroku-maven-plugin", "mvn-dependency-list.log");
// 
//         executeMojo(
//                 plugin(
//                         groupId("org.apache.maven.plugins"),
//                         artifactId("maven-dependency-plugin"),
//                         version("2.4")
//                 ),
//                 goal("list"),
//                 configuration(
//                         element(name("outputFile"), path.toString())
//                 ),
//                 executionEnvironment(
//                         mavenProject,
//                         mavenSession,
//                         pluginManager
//                 )
//         );
// 
//         return path;
//     }
// }


// Path: heroku-maven-plugin/src/main/java/com/heroku/sdk/maven/mojo/DeployMojo.java
import com.heroku.sdk.maven.MojoExecutor;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;

package com.heroku.sdk.maven.mojo;


/**
 * Deploys an application to Heroku.
 */
@Mojo(name="deploy", requiresDependencyResolution = ResolutionScope.RUNTIME)
@Execute(phase = LifecyclePhase.PACKAGE)
public class DeployMojo extends AbstractHerokuDeployMojo {

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    /* We vendor all dependencies into the build directory before deploying to ensure those are copied to the source
     * blob as well. This avoids that users have to explicitly copy dependencies to /target and is helpful in cases
     * where the user does not have deep knowledge about the Maven build process and/or did not configure many of the
     * plugins parameters.
     *
     * Advanced users should use DeployOnlyMojo which does not copy the dependencies.
     */
    MojoExecutor.copyDependenciesToBuildDirectory(super.mavenProject, super.mavenSession, super.pluginManager);