Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Maven Dependencies and Referenced Libraries in Eclipse?

In my maven eclipse project I see Maven dependency and Referenced Libraries. In some cases they have the same set of jars referring to M2_REPO. And in some they are entirely different. Leaves me confused as to why there are 2 different jar references in the same project.

like image 301
Sabarish Avatar asked Mar 15 '14 05:03

Sabarish


2 Answers

Maven dependencies are added in pom file to a project. When you build the project, maven dependencies that you have added in pom file will be downloaded from the M2 repository.

Reference libraries are added manually for projects in Eclipse IDE.

When you leave confusing for those jar files, just add all libraries as maven dependencies.

like image 131
E Do Avatar answered Sep 22 '22 18:09

E Do


Classes in both Referenced Libraries and Maven Dependencies are visible in Eclipse but Maven build can see only dependencies from pom. If you try to build the project with maven it may fail because of this

like image 42
Evgeniy Dorofeev Avatar answered Sep 26 '22 18:09

Evgeniy Dorofeev