This tutorial shows how to create a Maven project in Eclipse. Here I am using the maven Eclipse plugin. These days Eclipse comes pre-configured with maven plugin and you don't need to download and set up maven plugin yourself. To verify that you have maven plugin pre-configured in eclipse go to Windows - Preferences, there on the left side scrollable window search for Maven, if you have maven then it will look like this.
Creating Maven project structure in Eclipse
In Eclipse select File - New - Maven Project
That will open a Wizard for creating “New Maven Project”, check “Create a simple project (skip archetype selection)”. Click Next.
In the next window provide group ID and artifact ID and other details.
- groupId- This element indicates the unique identifier of the organization or group that created the project. GroupId is typically based on the fully qualified domain name of your organization. For example com.companyName.finance is the designated groupId for all finanace related projects.
- artifactId- This element indicates the unique base name of the primary artifact being generated by this project. The primary artifact for a project is typically a JAR file. A typical artifact produced by Maven would have the form
- . (for example, myapp-1.0.jar). - packaging- This element indicates the package type to be used by this artifact (e.g. JAR, WAR, EAR, etc.). The default value for the packaging element is JAR so you do not have to specify this for most projects.
- version- This element indicates the version of the artifact generated by the project.
- name- This element indicates the display name used for the project. This is often used in Maven's generated documentation.
- description- This element provides a basic description of your project. This is often used in Maven's generated documentation.
Click Finish. You should get a project structure similar to as shown below.
You can change the default JRE system library to current Java version by going to Java build path and changing the JRE library.
That's all for this topic Creating a Maven Project in Eclipse. If you have any doubt or any suggestions to make please drop a comment. Thanks!
>>>Return to Java Advanced Tutorial Page
Related Topics
You may also like-