Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.MojoExecutionException


      try {
        log.info("Deleting directory " + dojoDirectory.getAbsolutePath());
        FileUtils.deleteDirectory(dojoDirectory);
      } catch (IOException e) {
        log.error("Failed to clean dojo build environment", e);
        throw new MojoExecutionException("Failed to clean dojo build environment");
      }
    }
  }
View Full Code Here


        try {
          log.info("Deleting directory " + file.getAbsolutePath());
          FileUtils.deleteDirectory(file);
        } catch (IOException e) {
          log.error("Failed to clean dojo build environment", e);
          throw new MojoExecutionException("Failed to clean dojo build environment");
        }
      } else {
        log.info("Deleting file " + file.getAbsolutePath());
        if (!file.delete()) {
          throw new MojoExecutionException("Cannot delete " + file.getAbsolutePath());
        }
      }
    }
  }
View Full Code Here

      archiver.addDirectory(releaseDirectory, new String[]{"*/**"}, new String[]{});
      archiver.setDestFile(new File(dojoDirectory, RELEASE_DIR + ".jar"));
      archiver.createArchive();
    } catch (Exception e) {
      log.error("Failed to archive dojo build", e);
      throw new MojoExecutionException("Failed to archive dojo build");
    }
  }
View Full Code Here

      log.info("Writing profile " + profile.getAbsolutePath());
      FileUtils.fileWrite(profile.getAbsolutePath(), sb.toString());
      return profile;
    } catch (IOException e) {
      log.error("Failed to write profile file", e);
      throw new MojoExecutionException("Failed to write profile file");
    }
  }
View Full Code Here

      unArchiver.setOverwrite(false);
      unArchiver.extract();
      log.info("Unpacked artifact archive " + archive.getName());
    } catch (Exception e) {
      log.error("Failed to unpack artifact archive " + archive.getName(), e);
      throw new MojoExecutionException("Failed to unpack artifact archive " + archive.getName());
    }
  }
View Full Code Here

      throws MojoExecutionException {
    Artifact artifact = artifactFactory.createArtifactWithClassifier(groupId, id, version, type, classifier);
    try {
      resolver.resolve(artifact, remoteRepositories, localRepository);
    } catch (ArtifactNotFoundException e) {
      throw new MojoExecutionException("artifact not found - " + e.getMessage(), e);
    } catch (ArtifactResolutionException e) {
      throw new MojoExecutionException("artifact resolver problem - " + e.getMessage(), e);
    }
    return artifact;
  }
View Full Code Here

      ua.setDestDirectory(resourceDir);
      ua.setOverwrite(true);
      ua.extract();
    } catch (IOException e) {
      getLog().error("Failed to copy dojo release jar", e);
      throw new MojoExecutionException("Failed to copy dojo release jar");
    } catch (NoSuchArchiverException e) {
      getLog().error("Failed to unarchive dojo release jar", e);
      throw new MojoExecutionException("Failed to unarchive dojo release jar");
    } catch (ArchiverException e) {
      getLog().error("Failed to unarchive dojo release jar", e);
      throw new MojoExecutionException("Failed to unarchive dojo release jar");
    }
  }
View Full Code Here

    try {
      log.info("Executing " + commandLine.toString());
      int resultCode = CommandLineUtils.executeCommandLine(commandLine, new LogStream(), new LogStream());
      if (resultCode > 0) {
        throw new MojoExecutionException("Result of " + commandLine + " execution is: '" + resultCode + "'.");
      }
    } catch (CommandLineException e) {
      throw new MojoExecutionException("Command execution failed.", e);
    }
  }
View Full Code Here

      System.out.println("Extract source " + source.getAbsolutePath());
      System.out.println("Extract dest   " + destination.getAbsolutePath());
      scanDirectory(source, destination);
    } catch (Throwable ex) {
      throw new MojoExecutionException("problems while running extract source plugin\n" + ex.getMessage(), ex);
    }
  }
View Full Code Here

        archiver.setDestFile(xarDirectory);
        try {
            buildArchive(archiver);
            archiver.createArchive();
        } catch (ArchiverException e) {
            throw new MojoExecutionException("Unable to build archive", e);
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to build archive", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.MojoExecutionException

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.