Create Maven Hello World Eclipse
Below I will show you how to create maven Web Application Hello World project in eclipse. Please follow below steps:
Below are needed
- Eclipse Kepler (Download eclipse from here)
- To create project using Eclipse you will have to install JBoss Tools plug-in using this tutorial
- JDK 1.5 or above (Download from here: JDK 1.5 )
Steps:
- Open your eclipse –> File –> New –> Maven Project ( Note: If don’t see Maven project: Click Other –> Maven –> Maven Project)
- On next window click Next
- Choose maven-archtype-webapp –>Click Next
Enter as below:
- Group Id — Your package structure (You can change later)
- Artifact Id: Name of your project
- Version: Leave default selected
- Package : Enter your package name or copy from group id
- Click Finish
- Once you finish you will see below project structure:
- Eclipse Kepler automatically create dynamic web module with 2.3 version. To check right click to the project –> Click properties –>Project Facets –>Dynamic web module
- Now right click project –> Click Properties –> Java Build Path you will it complains 2 build path entries are missing. Let’s create those those two entries to the project
- Go to your project workspace location and create two folder
- Folder name: test –>Inside src and folder name java –> inside test
- Folder name: java –> Inside src/main
- Refresh your project go to java build path configuration build path entries issue should be resolved now.
- For test I have use tomcat server. Please configure latest version of tomcat to your eclipse (If you are not sure how to do this use this link: Configure and Run Tomcat server in eclipse)
- To run it –> Right click project –> Run As –> Run on Server
- Select server tomcat which you have configured to eclipse –>Click Next
- Select maven project to as below –> Click Finish
- You will see below Hello World. That’s it.