MavenRepositorySystem { protected Model getEffectiveModel(File pom) { ModelBuildingRequest req = new DefaultModelBuildingRequest(); req.setProcessPlugins(false); req.setPomFile(pom); req.setModelResolver(new SimpleModelResolver(repositorySystem, createSession(), getRepositories(Collections.EMPTY_LIST))); req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL); ModelBuilder builder = new DefaultModelBuilderFactory().newInstance(); try { return builder.build(req).getEffectiveModel(); } catch(ModelBuildingException ex) { logger.warn("Could not build maven model.", ex); } return new Model(); } 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 testEffectiveModel() throws URISyntaxException { Model model = mavenRepositorySystem.getEffectiveModel(getTestPom()); assertThat(model.getDependencies(), allOf( hasItem(new DependencyMatcher("akka-actor", null, null)), hasItem(new DependencyMatcher("akka-remote", null, null)), hasItem(new DependencyMatcher("server", null, null)) )); assertThat(model.getDependencies().size(), is(equalTo(3))); }