Thursday, March 2, 2017

Java Web project with Maven in Eclipse

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 Help ▸ Install New Software. 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 Windows ▸ Preferences ▸ Maven 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.
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






1 comment:

  1. 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.

    White Label Website Builder

    ReplyDelete

Interview Prep: Java full stack

 SOLID principle :  https://www.educative.io/answers/what-are-the-solid-principles-in-java Design Pattern:  Creational:  https://medium.com...