1. Install the Maven support for Eclipse (m2e)
Most Eclipse downloads include the Maven tooling already. If it is missing in your installation, you can install it via the main update of your release via
. The following listing contains the update site for the Neon release and an update site maintained by the m2e project.// Neon update site
http://download.eclipse.org/releases/neon
// Update site provided by m2e project
http://download.eclipse.org/technology/m2e/releases
2. Download the Maven index
By default, the Maven tooling does not download the Maven index for the Eclipse IDE. Via the Maven index you can search for dependencies, select them and add them to your pom file. To download the index, select and enable the Download repository index updates on startup option.
3. Create a Java Web project in eclipse using Maven
Step 1. Go to File > Maven Project > Next. Then maven-archetype-webapp
Step 2 Name archetype. This will be the name of the project
And then press finish
Note -: If you see error “The superclass “
javax.servlet.http.HttpServlet
” was not found on the Java Build Path index.jsp /CrunchifyMavenTutorial/src/main/webapp” then add below maven dependency.
1
2
3
4
5
|
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
|
OR
add Apache Tomcat to your Targeted Runtimes
.
Step 3 : Under run > maven build , type: clean install as goal
Step 4: Add Target Runtime and run web application.Now run on server
You provide a very good blog.Thanks for sharing this kind of information.really it is very interesting onto read.Anybody want to build your own website.
ReplyDeleteWhite Label Website Builder