private MavenProject newProject(final String... classpath)
     throws DependencyResolutionRequiredException {
   MavenProject project = createMock(MavenProject.class);
   expect(project.getRuntimeClasspathElements()).andReturn(Lists.newArrayList(classpath));
   replay(project);
   return project;
 }
  private List<String> getClasspathForScope(
      ProjectBuildingResult projectBuildingResult, String scope)
      throws DependencyResolutionRequiredException {
    MavenProject project = projectBuildingResult.getProject();

    if ("compile".equalsIgnoreCase(scope)) {
      return project.getCompileClasspathElements();
    } else if ("runtime".equalsIgnoreCase(scope)) {
      return project.getRuntimeClasspathElements();
    }
    return project.getTestClasspathElements();
  }
  //  copy libs to script dir
  private void prepareRuntimeExecutionDependencies(MavenProject project)
      throws MavenRuntimeBuilderException {
    try {
      List classpathElements = project.getRuntimeClasspathElements();

      for (Iterator i = classpathElements.iterator(); i.hasNext(); ) {
        String element = (String) i.next();

        if (element.endsWith(".jar")) {
          FileUtils.copyFileToDirectory(
              (String) i.next(), runtimeLibraryDirectory.getAbsolutePath());
        }
      }
    } catch (Exception e) {
      throw new MavenRuntimeBuilderException("unable to prepare runtime execution dependencies", e);
    }
  }