Eclipse Maven plugin usage

How to use Eclipse Maven Integration plugin. Installation and basic troubleshooting. How to add dependencies into pom.xml file, rebuild indexes of your repositories and update Maven project.

In order to use Maven inside Eclipse, you must first install "Maven Integration for Eclipse" plugin from Eclipse Marketplace. Or use STS aka SpringSource Tool Suite or other bundle which has Maven integrated.

If you see this error during build: "Please ensure you are using JDK 1.4 or above and not a JRE", then your Maven runs using JRE, not JDK. Solution is simple, goto Window -> Preferences -> Installed JREs, add your JDK and select it as default.

Now Maven works fine in Eclipse.

If you cannot find Maven archetypes or dependencies in Eclipse wizards, goto Window -> Show View -> Maven Repositories and rebuild indexes of your Global and Local repositories.

Sometimes if you do some radical change in pom.xml file, Eclipse will need to update Maven project. To do so, right click on project, choose Maven -> Update Project.