I am completely new to Maven and Spring MVC. What I am looking to do is to set up a new Spring MVC project, using Maven (hopefully this sentence makes sense), and run my web app on Tomcat using Eclipse.
I am following the tutorial at this link and I have a problem with the pom.xml
file:
The tutorial asks to create the folder structure, and to create a pom.xml file. For starters they ask to put this line in pom.xml:
xml 4.0.0org.springsource.greenbeans.mavenexample11.0-SNAPSHOTOur Simple Project
But when I do that, my Eclipse throws an error:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (D:\projectName\pom.xml) has 1 error
[ERROR] Non-parseable POM D:\projectName\pom.xml: only whitespace content allowed before start tag and not ` (position: START_DOCUMENT seen `... @1:1) @ line 1, column 1 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
Any idea on what the right minimum pom.xml could be? I tried many things but it didn't work for me...
You need not create folder structure yourself. Maven archtype 'maven-archetype-webapp' does it for you. Here is a good tutorial to guide you through for basic setting up a MVC project in eclipse (and the right approach):
Create Spring MVC dynamic web project with Maven and make it support Eclipse IDE
The minimal
pom.xml
file for Spring MVC with Tomcat could be:And then: