// Add the ATF nature as well.
ATFNature.addNature(project, new NullProgressMonitor());
// Installs the static web project facet.
IFacetedProject faceted = ProjectFacetsManager.create(project);
IFacetedProjectTemplate tpl = ProjectFacetsManager
.getTemplate("template.wst.web");
Set<IProjectFacet> facets = tpl.getFixedProjectFacets();
// There should be only one fixed facet. If there's more, this code will
// need to be reviewed.
Assert.assertEquals(1, facets.size());
IProjectFacet facet = facets.iterator().next();
// Creates the data model for configuring the facet.
IDataModel config = DataModelFactory
.createDataModel(new SimpleWebFacetProjectCreationDataModelProvider());
config = initConfig(config, facet.getDefaultVersion(),
IFacetedProject.Action.Type.INSTALL, projectName);
faceted.installProjectFacet(facet.getDefaultVersion(), config,
new NullProgressMonitor());
return project;
}