use of org.eclipse.che.maven.data.MavenModel in project che by eclipse.
the class MavenServerTest method testInterpolateModel.
@Test
public void testInterpolateModel() throws Exception {
MavenModel model = new MavenModel();
model.setMavenKey(new MavenKey("aaa", "bbb", "ccc"));
model.getBuild().setSources(Collections.singletonList("src/main/java"));
model.getBuild().setTestSources(Collections.singletonList("src/test/java"));
MavenModel interpolateModel = MavenServerImpl.interpolateModel(model, new File(MavenServerTest.class.getResource("/EffectivePom/pom.xml").getFile()));
Assert.assertNotNull(interpolateModel);
}
use of org.eclipse.che.maven.data.MavenModel in project che by eclipse.
the class MavenModelReader method readMavenProject.
public MavenModelReaderResult readMavenProject(File pom, MavenServerManager serverManager) {
Pair<ModelReadingResult, Pair<List<String>, List<String>>> readResult = readModel(pom);
MavenModel model = readResult.first.model;
model = serverManager.interpolateModel(model, pom.getParentFile());
Pair<List<String>, List<String>> profilesPair = readResult.second;
return new MavenModelReaderResult(model, profilesPair.first, profilesPair.first, readResult.first.problems, Collections.emptySet());
}
use of org.eclipse.che.maven.data.MavenModel in project che by eclipse.
the class MavenServerManagerTest method testResolveMultimoduleProjectMainPom.
@Test
public void testResolveMultimoduleProjectMainPom() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/multimoduleProject/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
MavenProjectInfo projectInfo = resolveProject.getProjectInfo();
assertNotNull(projectInfo);
MavenModel mavenModel = projectInfo.getMavenModel();
assertNotNull(mavenModel);
assertThat(mavenModel.getPackaging()).isEqualTo("pom");
assertThat(mavenModel.getModules()).containsExactly("subModule", "test");
assertThat(mavenModel.getDependencies()).isEmpty();
}
Aggregations