How to import the maven project in Eclipse?

By | October 24, 2020

This tutorial talks about How to import the maven project in Eclipse?

Below are the steps to import a maven project in Eclipse:

  1. In Eclipse select File -> Import…
  2. In the import window, expand Maven and then select Existing Maven Projects and click the Next button

3. Click on Browse then select the directory that contains the pom.xml file of the project that we want to import and click on Finish

Once Import is done, You can see the following Maven project in Eclipse:

Explanation of Above Maven Project Directory Structure:

src -> It is the directory that is the root directory of source code and test code.
main -> It is the directory is the root directory for source code related to the application itself, not test code.
java -> Directories under main and test contain the Java code for the application itself which is under main and the Java code for the tests which is under test.
test -> Itis the directory contains the test source code.
target -> This is the directory created by Maven which contains all the compiled classes, JAR files etc..

NOTE: When executing the mvn clean command, Maven would clean the target directory.

src/main/java – > contains java source code files under the package structure(com.kkjavatutorials)

src/main/test – > contains test java source code files under the package structure (com.kkjavatutorials)

That’s all about How to import the maven project in Eclipse?

You May Also Like:

What is Maven?
How to install and setup Maven Environment on windows?
Create a maven project using the command line
How to Create a New Maven Project in Eclipse
How to create a maven web application project in Eclipse
How to create a multi-module project using maven?
How to Fix missing src/main/java & src/test/java folders in the Eclipse Maven web Project?
How to create user-defined properties in Maven?
What is the maven local repository location & how to change it?
How to add or update the maven settings.xml file in eclipse?
Importing maven remote Archetype Catalogs in eclipse ?
What is POM in the maven Project?
What is Super POM in Maven Project?
Understanding the purpose of Maven Plugin
Compiling the Maven project with different JDK versions? 
Understanding of settings.xml in maven
How to enable a proxy setting in Maven?
Maven Dependency Scopes
How to generate javadoc in the maven Project
How to create a runnable JAR file with Maven?
How to add local jar files to a Maven project?
How to convert an existing Java Project to Maven in Eclipse?
How to exclude dependency in maven?
Managing External Dependencies in maven
Understanding of Maven Repositories
What is an archetype in Maven?
Snapshot Vs Version in maven
Apache Maven – Profiles

If you have any feedback or suggestion please feel free to drop in below comment box.


Leave a Reply

Your email address will not be published. Required fields are marked *