Java 类org.apache.maven.model.building.DefaultModelProcessor 实例源码

项目:migration-tooling    文件:Resolver.java   
/**
 * Given a local path to a Maven project, this attempts to find the transitive dependencies of the
 * project.
 *
 * @param projectPath The path to search for Maven projects.
 * @param scopes The scopes to look up dependencies in.
 */
public String resolvePomDependencies(String projectPath, Set<String> scopes) {
  DefaultModelProcessor processor = new DefaultModelProcessor();
  processor.setModelLocator(new DefaultModelLocator());
  processor.setModelReader(new DefaultModelReader());
  File pom = processor.locatePom(new File(projectPath));
  FileModelSource pomSource = new FileModelSource(pom);
  // First resolve the model source locations.
  resolveSourceLocations(pomSource);
  // Next, fully resolve the models.
  Model model = modelResolver.getEffectiveModel(pomSource);
  if (model != null) {
    traverseDeps(model, scopes, Sets.newHashSet(), null);
  }
  return pom.getAbsolutePath();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootDependenciesDependencyManagement.java   
private static Model readModel() {
    DefaultModelProcessor modelProcessor = new DefaultModelProcessor();
    modelProcessor.setModelLocator(new DefaultModelLocator());
    modelProcessor.setModelReader(new DefaultModelReader());

    try {
        return modelProcessor.read(SpringBootDependenciesDependencyManagement.class
                .getResourceAsStream("effective-pom.xml"), null);
    }
    catch (IOException ex) {
        throw new IllegalStateException("Failed to build model from effective pom",
                ex);
    }
}
项目:spring-boot-concourse    文件:SpringBootDependenciesDependencyManagement.java   
private static Model readModel() {
    DefaultModelProcessor modelProcessor = new DefaultModelProcessor();
    modelProcessor.setModelLocator(new DefaultModelLocator());
    modelProcessor.setModelReader(new DefaultModelReader());

    try {
        return modelProcessor.read(SpringBootDependenciesDependencyManagement.class
                .getResourceAsStream("effective-pom.xml"), null);
    }
    catch (IOException ex) {
        throw new IllegalStateException("Failed to build model from effective pom",
                ex);
    }
}
项目:contestparser    文件:SpringBootDependenciesDependencyManagement.java   
private static Model readModel() {
    DefaultModelProcessor modelProcessor = new DefaultModelProcessor();
    modelProcessor.setModelLocator(new DefaultModelLocator());
    modelProcessor.setModelReader(new DefaultModelReader());

    try {
        return modelProcessor.read(SpringBootDependenciesDependencyManagement.class
                .getResourceAsStream("effective-pom.xml"), null);
    }
    catch (IOException ex) {
        throw new IllegalStateException("Failed to build model from effective pom",
                ex);
    }
}