I am learning building a Java project in Eclipse using Maven. I created a Java project HelloWorld
from
“maven-archetype-quickstart” template in a folder D:/maven_projects
. Then to convert the Maven project to support Eclipse IDE, I navigated into the project folder and issued the commands:mvn eclipse:eclipse
and mvn package
.
Then I imported the project in Eclipse and did the necessary Eclipse configurations like setting the Maven local repository in Eclipse classpath. Now the project in D:/EclipseWorkspace
folder. I ran the project successfully in Eclipse printing "helloworld".
Now if I want to go on develop the project and for that reason want to add new dependencies in pom.xml in Eclipse, then the new jars are not added in classpath when I run the project.
So my question is after importing a Maven project into Eclipse how can I add more and more dependencies in pom.xml, then build and run the project? What is the recommended and efficient way to do this?