Package org.apache.maven.cli

Examples of org.apache.maven.cli.ConsoleDownloadMonitor


        MavenProject parent = maven.readProject(getDefaultArchetypePom(new File(targetDir, "pom.xml")));
        System.setProperties((Properties) sysProps.clone());
        maven.execute(parent,
                      Collections.singletonList("archetype:create"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      props,
                      targetDir);
        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));
        maven.execute(prj,
                      Collections.singletonList("package"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      new Properties(),
                      targetDir);
    }
View Full Code Here


        System.setProperties((Properties) sysProps.clone());

        maven.execute(parent,
                Collections.singletonList(getArchetypeGenerateGoal()),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                props,
                targetDir);


        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));

        maven.execute(prj,
                Collections.singletonList("package"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                new Properties(),
                targetDir);
    }
View Full Code Here

        System.setProperties((Properties) sysProps.clone());

        maven.execute(parent,
                Collections.singletonList("archetype:generate"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                props,
                targetDir);


        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));

        maven.execute(prj,
                Collections.singletonList("package"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                new Properties(),
                targetDir);
    }
View Full Code Here

        System.setProperties((Properties) sysProps.clone());
        System.setProperty("user.dir", targetDir.getAbsolutePath());
        maven.execute(parent,
                      Collections.singletonList("archetype:create"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      props,
                      targetDir);

        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, "sample");
        System.setProperty("user.dir", targetDir.getAbsolutePath());
        System.setProperty("basedir", targetDir.getAbsolutePath());
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));
        maven.execute(prj,
                      Collections.singletonList("package"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      new Properties(),
                      targetDir);
    }
View Full Code Here

        MavenProject parent = maven.readProject(getDefaultArchetypePom(new File(targetDir, "pom.xml")));
        System.setProperties((Properties) sysProps.clone());
        maven.execute(parent,
                      Collections.singletonList("archetype:create"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      props,
                      targetDir);
        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));
        maven.execute(prj,
                      Collections.singletonList("package"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      new Properties(),
                      targetDir);
    }
View Full Code Here

        System.setProperties((Properties) sysProps.clone());

        maven.execute(parent,
                Collections.singletonList(getArchetypeGenerateGoal()),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                props,
                targetDir);


        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));

        maven.execute(prj,
                Collections.singletonList("package"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                new Properties(),
                targetDir);
    }
View Full Code Here

        System.setProperties((Properties) sysProps.clone());

        maven.execute(parent,
                Collections.singletonList("archetype:generate"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                props,
                targetDir);


        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, props.getProperty("artifactId"));
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));

        maven.execute(prj,
                Collections.singletonList("package"),
                eventMonitor,
                new ConsoleDownloadMonitor(),
                new Properties(),
                targetDir);
    }
View Full Code Here

        System.setProperties((Properties) sysProps.clone());
        System.setProperty("user.dir", targetDir.getAbsolutePath());
        maven.execute(parent,
                      Collections.singletonList("archetype:create"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      props,
                      targetDir);

        System.setProperties((Properties) sysProps.clone());
        targetDir = new File(targetDir, "sample");
        System.setProperty("user.dir", targetDir.getAbsolutePath());
        System.setProperty("basedir", targetDir.getAbsolutePath());
        MavenProject prj = maven.readProject(new File(targetDir, "pom.xml"));
        maven.execute(prj,
                      Collections.singletonList("package"),
                      eventMonitor,
                      new ConsoleDownloadMonitor(),
                      new Properties(),
                      targetDir);
    }
View Full Code Here

  private void executeReport(EventMonitor eventMonitor, ReportHandler reportHandler) throws MojoExecutionException {
    // add snapshots repository...
    for (String command : reportHandler.getCommands()) {
      try {
        maven.execute( executedProject, Arrays.asList(new String[]{command}), eventMonitor,
                       new ConsoleDownloadMonitor(), null, executedProject.getBasedir());
      } catch (Throwable e) {
        if (reportHandler.mustFailOnError()) {
          getLog().error( "Cannot execute the command " + command, e );
          throw new MojoExecutionException( "Cannot execute the command " + command, e );
        } else {
View Full Code Here

              .getContextClassLoader());
          embedder.start();
          embedder.execute(reactorProjects, Collections
              .singletonList(qualifiedGoal), new DefaultEventMonitor(
              new PlexusLoggerAdapter(embedder.getLogger())),
              new ConsoleDownloadMonitor(), properties,
              ((MavenProject) reactorProjects.get(0)).getBasedir());
          embedderWorked = true;
        }
        catch ( Exception ex)
        {
View Full Code Here

TOP

Related Classes of org.apache.maven.cli.ConsoleDownloadMonitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.