Community
Participate
Working Groups
I have a web project with the following entries in the org.eclipse.wst.common.component file: <?xml version="1.0" encoding="UTF-8"?> <project-modules id="moduleCoreId" project-version="1.5.0"> <wb-module deploy-name="MyWeb"> <wb-resource deploy-path="/" source-path="/WebContent"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/> <wb-resource deploy-path="/WEB-INF/web.xml" source-path="/WebContent/WEB-INF/web.xml"/> <property name="context-root" value="MyWeb"/> <property name="java-output-path" value="/MyWeb/build/classes"/> </wb-module> </project-modules> The method JavaEESingleRootCallback#hasDefaultWebResourceMappings returns the error JavaEESingleRootCallback.RUNTIME_PATH_NOT_ROOT_OR_WEBINF_CLASSES (and therefore the project is not considered as single root) because of this entry: <wb-resource deploy-path="/WEB-INF/web.xml" source-path="/WebContent/WEB-INF/web.xml"/> But technically, that entry should not make the project non-single root, because there is another entry that maps everything under /WebContent to /. The entry is redundant and unnecessary , and we could warn the caller of this.
Created attachment 197649 [details] Proposed patch With this patch, a warning is returned (instead of an error) in JavaEESingleRootCallback#hasDefaultWebResourceMappings when a redundant entry is found. By redundant entry, I mean that the path mapped to / (in this case, /WebContent) concatenated to the deploy path of the entry (in this case, /WEB-INF/web.xml") is equals to the source path of the entry. This way, we would not allow entries that map files or folders to other folders different from the source path (e.g.,mapping /WebContent/WEB-INF/web.xml to /WEB-INF/otherFolder/web.xml)
approved
Code committed to R3_2_maintenance for WTP 3.2.5. I will keep this defect open until branch for 3.3.1 is available to commit to 3.3.1 and HEAD
Committed to HEAD. That will cover WTP 3.3.1 and 3.4