use of org.eclipse.che.maven.data.MavenBuild in project che by eclipse.
the class MavenModelUtil method convertToMavenModel.
public static Model convertToMavenModel(MavenModel model) {
Model result = new Model();
result.setArtifactId(model.getMavenKey().getArtifactId());
result.setGroupId(model.getMavenKey().getGroupId());
result.setVersion(model.getMavenKey().getVersion());
result.setPackaging(model.getPackaging());
result.setName(model.getName());
if (model.getParent() != null) {
Parent parent = new Parent();
MavenKey parentKey = model.getParent().getMavenKey();
parent.setArtifactId(parentKey.getArtifactId());
parent.setGroupId(parentKey.getGroupId());
parent.setVersion(parentKey.getVersion());
parent.setRelativePath(model.getParent().getRelativePath());
result.setParent(parent);
}
result.setProperties(model.getProperties());
result.setModules(model.getModules());
result.setBuild(new Build());
MavenBuild modelBuild = model.getBuild();
convertToMavenBuildBase(modelBuild, result.getBuild());
result.getBuild().setSourceDirectory(modelBuild.getSources().get(0));
result.getBuild().setTestSourceDirectory(modelBuild.getTestSources().get(0));
result.setProfiles(convertToMavenProfiles(model.getProfiles()));
return result;
}
use of org.eclipse.che.maven.data.MavenBuild in project che by eclipse.
the class MavenModelReader method fillModelByDefaults.
private void fillModelByDefaults(MavenModel model) {
model.setMavenKey(new MavenKey("unknown", "unknown", "unknown"));
final MavenKey parentKey = new MavenKey("unknown", "unknown", "unknown");
model.setParent(new MavenParent(parentKey, "../pom.xml"));
model.setPackaging("jar");
model.setModules(emptyList());
final MavenBuild build = model.getBuild();
build.setSources(singletonList(DEFAULT_SOURCE_FOLDER));
build.setTestSources(singletonList(DEFAULT_TEST_SOURCE_FOLDER));
build.setResources(singletonList(new MavenResource(DEFAULT_RESOURCES_FOLDER, false, null, Collections.emptyList(), Collections.emptyList())));
build.setTestResources(singletonList(new MavenResource(DEFAULT_TEST_RESOURCES_FOLDER, false, null, Collections.emptyList(), Collections.emptyList())));
}
Aggregations