How to Import Maven project in eclipse - And Troubleshooting while importing

You are here : Home / Core Java Tutorials





Import Maven project in eclipse
Go to File, Import..

Type existing maven project,
select Existing Maven Project
And click Next>


Unzip the downloaded project and browse for directory in which you have kept it.

Click Next>

And project will be imported in eclipse >
See final directory structure




Troubleshooting while importing project in eclipse >

Solved maven-compiler-plugin - compile error in eclipse - m2


You may error like No marketplace entries found to handle maven-compiler-plugin:2.3.2:compile in Eclipse.
This error indicates that maven compiler plugins are missing so your project won’t be compiled.

Root cause of problem >
This error was caused because of missing Maven-resources-plugin-2.3.2.jar

Maven-resources-plugin-2.3.2.jar should've been there in C:\Users\ankitmittal\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3.2 but the folder was missing.



Step 1 >
So, I added dependency in pom.xml >

<!--https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
<dependency>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jar-plugin</artifactId>
   <version>2.3.2</version>
</dependency>


Step 2 >
Now, Right click on pom.xml > select Run As > Then Maven clean  
Now, Right click on pom.xml > select Run As > Then Maven install

Refresh the project (F5 or by doing right click on project) - Required only if dependency are not updated.

Right click on project - Maven - Update Project..  (Alt + F5) - Required only if dependency are still not updated.


Step 3 (Problem is resolved this point) >
You will see that
C:\Users\ankitmittal\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3.2\Maven-resources-plugin-2.3.2.jar Will get downloaded and your problem will be solved.


Labels: eclipse Maven
eEdit
Must read for you :