James
James

Reputation: 335

converting a Webproject into maven project structure

I have the below Web project which is working fine. I wanted to change the structure of the project into a maven project structure.

enter image description here

So, I modified the project to as shown below(I created a new folder called webapp under src/main and I moved the contents of the folder WebContent into webapp and I deleted WebContent folder) Now the application doesn't work although I deploy it in the Tomcat Server. What is wrong in the below project structure . Please help me out

enter image description here

EDIT: I wanted a maven project structure as shown below which is a standard maven project structure

enter image description here

Upvotes: 1

Views: 354

Answers (2)

Harneet Singh
Harneet Singh

Reputation: 2556

The structure you are looking for can be defined at the time of project creation in the source directory screen. If you have an existing project you will need to add a new source folder.

To do so,

  1. Add the folders to your project.
  2. Right click on folder > build path > use as source folder.

Upvotes: 0

Mrl0330
Mrl0330

Reputation: 140

If you are using eclipse (which it looks like you are), you can use the M2Eclipse plugin, which will provide a "convert to maven" utility. Simply right click the project and go to configure -> convert to Maven.

https://www.eclipse.org/m2e/

Upvotes: 2

Related Questions