In the previous post, we have created the mvn project & converted into an eclipse project. In this step we will import the existing project into eclipse work-space & will update the default pom.xml file, will add the required dependencies into the pom.xml file.
Please follow the below steps to import the project into workspace:
Please follow the below steps to import the project into workspace:
- Open Eclipse > Right Click on Package Explorer > Click on Import
- Select Existing Project into Workspace > Click on Next button > Select root directory > Click on Browse button > Select the project > Click on Finish Button.
Challenges:After importing the project if you sees a red ! mark in the project, then add the M2_REPO into the classpath variable.
To add M2_REPO into the classpath variable please follow the below steps:
In eclipse click on Window > Preferences > Java > Build Path > Classpath Variables > Click on New
Insert M2_REPO in Name & give the path of repository directory(In my case its C:/Users/SwarajKumar/.m2/repository)
Click on OK. Click on Project > Clean the project. Now the red symbol(problem) will be solved.
Add the required dependency files into pom.xml file or replace the attached pom.xml with the existing pom.xml file.
Note: After replacing the pom.xml file, Open command prompt(run as administrator) > Navigate to project directory(F:\Workspace\POM_Demo) > run the command "mvn eclipse:eclipse"
No comments:
Post a Comment