If a maven project uses web resource filtering and is referencing JSF libraries, then, during the JSF Facet installation, org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate will create the faces-config.xml file in the first resource folder found in .settings/org.eclipse.wst.common.component, for instance :
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="simple-jsf">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="simple-jsf"/>
<property name="java-output-path" value="/simple-jsf/target/classes"/>
</wb-module>
</project-modules>
-> target/m2e-wtp/web-resources/WEB-INF/faces-config.xml
target/ is a derived folder (at least in m2e-core 0.13), and faces-config.xml belongs to the source folders.
The code responsible for this is
private IPath resolveConfigPath(final IProject project, final String jsfConfigPath) {
return ComponentCore.createComponent(project).getRootFolder()
.getUnderlyingFolder().getRawLocation().append(
new Path(jsfConfigPath));
}
Obviously, we'd need to fix it upstream. Until that happens, if it happens one day, we can take the WDD (Workaround Driven Development) route :
- either we try putting the correct source folder first, if needed, before adding the facet, then reverting the change once the JSF facet is added.
- check if the faces-config.xml file has been created under target/m2e-wtp/web-resources/WEB-INF/ and move it back to src/main/webapp/WEB-INF/
First solution seems really gross. I'm inclined to implement the 2nd one.
- clones
-
JBIDE-9226 JBossTools hangs when quickfixing : EL Validator cannot run on project a because Validation Builder precedes JBoss Knowledge Base Builder
-
- Closed
-