How to add a WebContent folder to a Eclipse project

9.5k views Asked by At

I started porting an old Google Web Tools project into Eclipse Oxygen. I've set it up in a "Google Web Tools" project template and it now compiles and runs.

My problem is that there are a lot of static images and html being left off the compiled project. Looking over other projects, it seems a Web-Content folder might be the ideal place to include these components. Unfortunately this is a feature of "Dynamic Web Application" projects. Is there anyway to add a Web-Content (or similar path) to other Eclipse project types?

2

There are 2 answers

1
El Hoss On BEST ANSWER

This is quite easy:

  • open the properties of the project and select 'project facts' and select 'Dynamic Web Project'

enter image description here

  • press apply

  • switch to GWT -> web application and change the WAR directory to 'WebContent'

enter image description here

  • apply

  • close the properties

  • copy everything from the war directory to the WebContent directory.

Hope that helps.

0
Bruno L. On

WebContent default directory has been replaced with /scr/maion/webapp since Eclipse 2021, then add WebContent/ in Properties, Deployment Assembly, Add, Folder