May be it a pretty basic question as I am starting to learn Maven.
Usually, we copy jar files to lib
folder under WEB-INF
folder. Eclipse uses those libraries to help during coding, like automatically importing the necessary packages, showing the class elements when you press . (dot), and auto-completing with Ctrl+Space, etc.
With maven
, the jars are not available in the project until we build/compile the project. That is when, it downloads all jar files. I am not sure if m2eclipse is of any use here.
Any idea how it works? Googling did not give me any info.
Eclipse is able to load the classes which are there in the project classpath. In non maven projects we add the libraries in project under Java Build Path manually, which gets added to the classpath. In case of maven projects, when we add dependencies in pom, eclipse add the jars in the classpath from M2_HOME directory. As soon as you save your pom, dependencies are downloaded in your M2_HOME directory and also added to your classpath.
The goal of the Eclipse m2eclipse project is to provide Apache Maven support in the Eclipse IDE, making it easier to edit Maven's pom.xml, run a build from the IDE and much more.