I need to change the default Eclipse WTP "Web Resources" dynamic folder. Currently it points to WebContent, and I need to point to src\main\webapp.
6 Answers
I found the solution:
Under .settings folder in your project's folder, there is a file named "org.eclipse.wst.common.component", inside it change the line <wb-resource deploy-path="/" source-path="/WebContent"/>
with <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
.
That's all!

- 457
- 2
- 5
- 17

- 700
- 1
- 5
- 17
-
I realize that you can add as many entries with deploy-path="/" as you want to indicate the whole web content folder. – CHiRo79 Aug 31 '10 at 09:19
-
11Rather than modifying the `.settings/org.eclipse.wst.common.component` file directly, you can manage the `deploy-path` entries under _Properties_ > _Deployment Assembly_. – penfold Feb 21 '12 at 01:25
-
1@penfold The problem is that in previous versions of Eclipse, I swear that it weren't possible... but I'm not sure 100%. – CHiRo79 May 15 '13 at 15:08
Give Preference to eclipse GUI!
if don't appear to you see this
Unable to find Deployment assembly Eclipse Juno
I prefer the following solution, as the configuration is then saved in the .project
file and also all files are kept visible in the Eclipse Project Explorer.
Create a Linked Folder called WebContent
pointing to /src/main/webapp
:
Right click project > New > Folder. Folder name: WebContent
. Advanced > Link to alternate location (Linked Folder): PROJECT_LOC/src/main/webapp
.

- 10,163
- 3
- 47
- 55
- Disable "Dynamic Web Module" project nature, click "Apply" button
- Enable previous option checkbox, notice "Feather configuration available..." at the bottom.
- Click "Feather configuration available..." link and change directory
- Click "Apply" button

- 20,010
- 25
- 97
- 140
Or you may even do a simple rename of WebContent directory. Eclipse will update the above mention settings files

- 9
- 1
-
1But, what if you want to use a existing directory like src/main/webapp? – CHiRo79 Aug 31 '10 at 09:15
-
1Renaming the directory inside Eclipse? I tried that outside Eclipse but it didn't work... – CHiRo79 Mar 02 '11 at 09:56
In my case the problem was that the jsp located in resources/templates were not found
The solution has been to change
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
by the following
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
That is, modifying the file
.settings\org.eclipse.wst.common.component

- 11
- 1