result.add(MavenDependencyFacet.class);
result.add(MavenResourceFacet.class);
MavenFacetImpl mavenFacetImpl = new MavenFacetImpl();
mavenFacetImpl.setOrigin(project);
if (!project.install(mavenFacetImpl))
{
throw new IllegalStateException("Could not install Maven into Project located at ["
+ dir.getFullyQualifiedName() + "]");
}