File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Adding dependency in pom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Adding dependency in pom " Watch "Adding dependency in pom " New topic

Adding dependency in pom

Arka Sharma
Ranch Hand

Joined: Jun 15, 2011
Posts: 103

I am having a project that I have created in Eclipse.This project conatins hibernate,drools.So I have added all the necessary jars in the project build path.Now I have created a maven quickstart archetype where inside main folder I have kept my java source and inside test directory I have kept my JUnit test sources.
Now in pom.xml I have added the dependencies by searching dependeny for the jars I have added in my build path in eclipse.But maven is unable to find repositories.I can manually install the jars using installer:install but it is too hectic because there are lots of jars.Is there any easy way to specify dependency for all the jars used in my project ?

Peter Johnson

Joined: May 14, 2008
Posts: 5852

Have you installed the m2eclipse plugin? If so, you can create a Maven Project. Then the POM editor will let you search the repositories for the dependencies you are interested in. Some dependencies might not be in Maven Central, so you will have to locate the repository they belong to and ad that repository to your settings.xml file (or you can add it to your pom.xml, or you can installed a repository manager such as Nexus and have it manage all of that for you. Personally, I would go with Nexus, that removes a lot of headaches.)

For Hibernate, and other JBoss-related artifacts, see this:

JBoss In Action
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Adding dependency in pom
jQuery in Action, 3rd edition