Maven - Maven with Eclipse IDE - maven tutorial
maven tutorial tags : apache maven , maven repository , maven central
How to use Maven With Eclipse IDE ?
- Maven also provides an excellent plugin which helps to integrate both eclipse and maven together.
- M2eclipse is the plugin used to integrate maven and eclipse.
- Some of the key benefits of this plugin:
- Run Maven goals from Eclipse.
- View the output of Maven commands inside the Eclipse using its own console.
- Update maven dependencies with IDE.
- Launch Maven builds from within Eclipse.
- It does the dependency management for Eclipse build path based on Maven's pom.xml.
- It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository (requires dependency project be in same workspace).
- Automatic downloads required dependencies and sources from the remote Maven repositories.
- It provides wizards for creating new Maven projects, pom.xml and to enable Maven support on existing projects
- It provides quick search for dependencies in remote Maven repositories
Install m2eclipse Plugin
- Follow the below link to easily install the m2eclipse plugin in your eclipse IDE.
- http://books.sonatype.com/m2eclipse-book/reference/ch02s03.html
Creating a maven project in eclipse
- Below is the step by step explanation on creating a maven project in eclipse.
- Step 1: Open the eclipse. Go to File -> New -> Project and search by the keyword maven and select Maven Project
learn maven tutorial - maven with eclipse IDE - maven example
- Step 2: Select the checkbox saying, Create a simple project and click on Next.
learn maven tutorial - Maven with eclipse IDE2 - maven example
- Step 3: Provide the details for groupId, artifactId, version and packaging as shown below and click on Finish.
learn maven tutorial - maven with eclipse IDE - maven example
- Step 4: A new project name SampleMavenProject will be created as shown below:
learn maven tutorial - maven eclipse IDE - maven example