[jbosstools-issues] [JBoss JIRA] Resolved: (JBIDE-8990) When adding the JSF facet to a maven project having filtered web resources, faces-config.xml is created in target/m2e/web-resources/WEB-INF
Fred Bricon (JIRA)
jira-events at lists.jboss.org
Tue May 24 18:05:00 EDT 2011
[ https://issues.jboss.org/browse/JBIDE-8990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fred Bricon resolved JBIDE-8990.
--------------------------------
Resolution: Done
If, when adding the JSF facet, faces-config.xml is generated in a folder different from the war source directory defined in the maven pom, it's moved back to the war source directory (or deleted if a WEB-INF/faces-config.xml already exists in the source directory)
> When adding the JSF facet to a maven project having filtered web resources, faces-config.xml is created in target/m2e/web-resources/WEB-INF
> -------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBIDE-8990
> URL: https://issues.jboss.org/browse/JBIDE-8990
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: maven
> Affects Versions: 3.2.0.Final
> Reporter: Fred Bricon
> Assignee: Fred Bricon
> Fix For: 3.3.0.M2
>
>
> 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 :
> {noformat}
> <?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>
> {noformat}
> -> 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
> {noformat}
> private IPath resolveConfigPath(final IProject project, final String jsfConfigPath) {
> return ComponentCore.createComponent(project).getRootFolder()
> .getUnderlyingFolder().getRawLocation().append(
> new Path(jsfConfigPath));
> }
> {noformat}
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list