IPath facesConfigPath = new Path("WEB-INF/faces-config.xml"); //$NON-NLS-1$
IFile defaultFacesConfig = warSourceDir.getFile(facesConfigPath);
IFolder generatedWebResourcesFolder = ProjectUtils.getGeneratedWebResourcesFolder(mavenProject, project);
IFile generatedFacesConfig = generatedWebResourcesFolder.getFile(facesConfigPath);
ResourceCleaner cleaner = new ResourceCleaner(project);
cleaner.addFolder(warSourceDir.getFolder("WEB-INF/lib")); //$NON-NLS-1$
cleaner.addFiles(defaultFacesConfig, generatedFacesConfig);
IStatus status = facetVersion.getConstraint().check(fproj.getProjectFacets());
try {
if (status.isOK()) {
IDataModel model = createJSFDataModel(fproj,facetVersion);
model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET, false);
fproj.installProjectFacet(facetVersion, model, monitor);
} else {
addErrorMarker(fproj.getProject(), NLS.bind(Messages.JSFProjectConfigurator_Marker_Facet_Version_Cant_Be_Installed, facetVersion, status.getMessage()));
for (IStatus st : status.getChildren()) {
addErrorMarker(fproj.getProject(), st.getMessage());
}
}
} finally {
cleaner.cleanUp();
}
}
}