Create a basic maven project
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.mycompany.app -DartifactId=my-app
With couple other prompts such as choosing version number, maven should then create a basic maven project structure.
Create Web Application structure
open up the folder that maven has created, and under src/main, create two new folders, 'resources' and 'webapp'. Your folder structure should looks like following./pom.xml ./src ./src/main ./src/main/java ./src/main/resources ./src/main/webapp ./src/main/webapp/WEB-INF ./src/test ./src/test/java
At the root of the directory structure is a XML file (always called pom.xml) that Maven expects. The pom.xml
(POM is short for Project Object Model) describes the things specific to your project that can't be inferred automatically like dependencies, the name of the project, etc.
Directory | Description Directory's Contents (relative to the project root) |
---|---|
src/main/java | Contains the Java source code for your project |
src/main/resources | Contains any classpath-relative resources for your project (like, a Spring application context .xml file) |
src/main/webapp | the root web context folder for your web application files, such as WEB-INF, jsp,etc |
src/test/java | Contains the java source code for your test classes. This directory will not be included in the final build. All tests herein will be compiled and all tests will be run. If the tests fail, it aborts the build. |
Modify pom.xml
replace pom.xml with http://codesfusion.blogspot.com/2012/04/spring-mvc-maven-pom_19.html which already includes the most basic dependencies for spring mvc project
Build your war
go to the root of your application foldermvn clean package
this will build your project and package it into a war file, which you can then deploy to your web application server
Following is a complete spring mvc setup using the instructions above. You can download it and revise for your mvc application
Sample Spring MVC Project
To import the project into your eclipse, you can use m2eclipse for your Eclipse IDE. http://www.sonatype.org/m2eclipse/
Great Article
ReplyDeleteJava Online Course | Java EE Training
Java Training Institutes in Chennai | java j2ee training institutes in chennai | Java Training in Chennai | J2EE Training in Chennai | Java Course in Chennai
Java Interview Questions | Java Training Institutes | IT Technical Articles
Great Article
ReplyDeleteJava Online Course | Java EE Training
Java Training Institutes in Chennai | java j2ee training institutes in chennai | Java Training in Chennai | J2EE Training in Chennai | Java Course in Chennai
Java Interview Questions | Java Training Institutes | IT Technical Articles
Java Training Institutes Java Training Institutes EJB Training Institutes in Chennai EJB Training Institutes in Chennai Java EE Training Institutes in Chennai Java EE Training Institutes in Chennai Java Training in CHennai |
ReplyDeleteSpring Online Training Spring Batch Training Online | Spring MVC Training in Chennai
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai
ReplyDeleteThanks for your blog!!.
ReplyDeleteJAVA Development Services
HR Pay Roll Software
SAP Software Services
Hotel Billing Software
Hospital Management Software
Web Design Company
I enjoyed your blog Thanks for sharing such an informative post. We are also providing the best services click on below links to visit our website.
ReplyDeleteweb design company in nagercoil
web development company in nagercoil
website design company in nagercoil
website development company in nagercoil
web designing company in nagercoil
website designing company in nagercoil
best web design company in nagercoil
web design company in velachery
web development company in velachery
website design company in velachery
website development company in velachery
web designing company in velachery
website designing company in velachery
best web design company in velachery
Thanks for Sharing - ( Groarz branding solutions )
thanks nice blog
ReplyDeletesolar rooftop in bangalore
solar ups in bangalore
solar street lights in bangalore
solar water heaters in bangalore
architectural pv solar in bangalore
solar water heater price in bangalore
best solar water heater in bangalore
amro renewables llp
Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai
ReplyDeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the
authors explore the idea of using Java in Big Data platforms.
Spring Training in Chennai
The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai
Im thankful for the article post.Thanks Again. Fantastic.
ReplyDeletejava online training hyderabad
java online training hyderabad