MavenRepositorySystem { public List<File> resolveDependenciesFromPom(File pom) throws DependencyResolutionException { Model model = getEffectiveModel(pom); HashSet<File> files = new HashSet<File>(); for(org.apache.maven.model.Dependency dependency : model.getDependencies()) { Artifact artifact = new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), dependency.getVersion()); files.addAll(resolveDependencies(artifact, model.getRepositories(), getSonatypeExclusions(dependency))); } return new ArrayList<File>(files); } MavenRepositorySystem(); List<File> resolveDependencies(String groupId, String artifactId, 
            String version); List<File> resolveDependencies(String coords); List<File> resolveDependenciesFromPom(File pom); void addRepository(RemoteRepository repository); void removeRepository(RemoteRepository repository); void addGlobalExclusion(String pattern); List<RemoteRepository> getRepositories(List<RemoteRepository> repositories); RemoteRepository createRemoteRepository(String id, String type, String url);  }
@Test public void testResolveDependenciesFromPom() throws URISyntaxException, DependencyResolutionException { List<File> dependencies = mavenRepositorySystem.resolveDependenciesFromPom(getTestPom()); assertThat(dependencies, allOf( hasItem(new FileNameMatcher("akka-actor-2.0.jar")), hasItem(new FileNameMatcher("scala-library-2.9.1-1.jar")), hasItem(new FileNameMatcher("akka-remote-2.0.jar")), hasItem(new FileNameMatcher("protobuf-java-2.4.1.jar")), hasItem(new FileNameMatcher("sjson_2.9.1-0.15.jar")), hasItem(new FileNameMatcher("dispatch-json_2.9.1-0.8.5.jar")), hasItem(new FileNameMatcher("httpclient-4.1.jar")), hasItem(new FileNameMatcher("httpcore-4.1.jar")), hasItem(new FileNameMatcher("commons-logging-1.1.1.jar")), hasItem(new FileNameMatcher("commons-codec-1.4.jar")), hasItem(new FileNameMatcher("objenesis-1.2.jar")), hasItem(new FileNameMatcher("commons-io-1.4.jar")), hasItem(new FileNameMatcher("h2-lzf-1.0.jar")), hasItem(new FileNameMatcher("server-3.0.1.jar")) )); assertThat(dependencies.size(), is(equalTo(14))); }