Package org.apache.maven.cli

Examples of org.apache.maven.cli.MavenCli$ExitException


   {
      if ((parms == null) || (parms.length == 0))
      {
         parms = new String[] { "" };
      }
      MavenCli cli = new MavenCli();
      int i = cli.doMain(parms, getOrigin().getProjectRoot().getFullyQualifiedName(),
               out, err);
      return i == 0;
   }
View Full Code Here


      final Logger globalLogger = Logger.getLogger(Strings.EMPTY);
      final Handler outHandler = new UncloseableStreamHandler(out, quiet);
      try
      {
         globalLogger.addHandler(outHandler);
         int returnCode = new MavenCli().doMain(params, getFaceted().getRoot().getFullyQualifiedName(), out, err);
         return returnCode == 0;
      }
      finally
      {
         globalLogger.removeHandler(outHandler);
View Full Code Here

      final Logger globalLogger = Logger.getLogger(Strings.EMPTY);
      final Handler outHandler = new UncloseableStreamHandler(out, quiet);
      try
      {
         globalLogger.addHandler(outHandler);
         int returnCode = new MavenCli().doMain(params, getFaceted().getRoot().getFullyQualifiedName(), out, err);
         return returnCode == 0;
      }
      finally
      {
         globalLogger.removeHandler(outHandler);
View Full Code Here

      final Logger globalLogger = Logger.getLogger(Strings.EMPTY);
      final Handler outHandler = new UncloseableStreamHandler(out, quiet);
      try
      {
         globalLogger.addHandler(outHandler);
         int returnCode = new MavenCli().doMain(params, getFaceted().getRoot().getFullyQualifiedName(), out, err);
         return returnCode == 0;
      }
      finally
      {
         globalLogger.removeHandler(outHandler);
View Full Code Here

        // need to backup (and later restore) the current class loader, because the Maven/Plexus does some classloader
        // magic which then results in CNFE in RestEasy client
        // run the Maven build which will create the kjar. The kjar is then either installed or deployed to local and
        // remote repo
        ClassLoader classLoaderBak = Thread.currentThread().getContextClassLoader();
        MavenCli cli = new MavenCli();
        String[] mvnArgs;
        if (LOCAL_SERVER) {
            // just install into local repository when running the local server. Deploying to remote repo will fail
            // if the repo does not exists.
            mvnArgs = new String[]{"-B", "clean", "install"};
        } else {
            mvnArgs = new String[]{"-B", "clean", "deploy"};
        }
        int mvnRunResult = cli.doMain(mvnArgs, basedir, System.out, System.out);
        if (mvnRunResult != 0) {
            throw new RuntimeException("Error while building Maven project from basedir " + basedir +
                    ". Return code=" + mvnRunResult);
        }
        Thread.currentThread().setContextClassLoader(classLoaderBak);
View Full Code Here

   {
      if ((parms == null) || (parms.length == 0))
      {
         parms = new String[] { "" };
      }
      MavenCli cli = new MavenCli();
      int i = cli.doMain(parms, getFaceted().getProjectRoot().getFullyQualifiedName(),
               out, err);
      return i == 0;
   }
View Full Code Here

   {
      if ((parms == null) || (parms.length == 0))
      {
         parms = new String[] { "" };
      }
      MavenCli cli = new MavenCli();
      int i = cli.doMain(parms, getFaceted().getProjectRoot().getFullyQualifiedName(),
               out, err);
      return i == 0;
   }
View Full Code Here

    PrintStream oldOut = System.out; // remember old System.out
    try {
      ByteArrayOutputStream stdout = new ByteArrayOutputStream();
      System.setOut(new PrintStream(stdout));

      int result = new MavenCli().doMain(args, ".", null, null);

      if (result != 0) {
        String log = FileUtils.readFileToString(tempFile);
        fail("sth went wrong : " + log);
      }
View Full Code Here

  @Override
  protected void prepareDistMore(Long testId, User user, FileEntry script, File distDir,
                                 PropertiesWrapper properties, ProcessingResultPrintStream processingResult) {
    String pomPathInSVN = PathUtils.join(getBasePath(script), "pom.xml");
    MavenCli cli = new MavenCli();
    processingResult.println("\nCopy dependencies by running 'mvn dependency:copy-dependencies"
        + " -DoutputDirectory=./lib -DexcludeScope=provided'");

    int result = cli.doMain(new String[]{ // goal specification
        "dependency:copy-dependencies", // run dependency goal
        "-DoutputDirectory=./lib", // to the lib folder
        "-DexcludeScope=provided" // but exclude the provided
        // library
    }, distDir.getAbsolutePath(), processingResult, processingResult);
View Full Code Here

   {
      if ((parms == null) || (parms.length == 0))
      {
         parms = new String[] { "" };
      }
      MavenCli cli = new MavenCli();
      int i = cli.doMain(parms, getFaceted().getRoot().getFullyQualifiedName(),
               out, err);
      return i == 0;
   }
View Full Code Here

TOP

Related Classes of org.apache.maven.cli.MavenCli$ExitException

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.