I am trying to convert a Java project which uses Ant into a Maven project, but am having difficulties finding out which dependencies to include.
How do I find out dependency settings for a particular import?
I am trying to convert a Java project which uses Ant into a Maven project, but am having difficulties finding out which dependencies to include.
How do I find out dependency settings for a particular import?
Provided you currently have the jars on your build-path, at least in Eclipse, when you CTRL + click an imported class, and you have selected "link with editor" on the package explorer, the bytecode outline is opened and the file is selected within the jar it is located.
Then, having the m2eclipse
plugin, you right-click your pom
-> Maven -> Add dependency, and type the name of the jar there. In most cases that would do.
How do I find out dependency settings for a particular import?
The easiest way to do that (in a generic way) is to use something like Jarvana, a "Maven-Focused Java Class and Archive Search Engine".
UPDATE: You'll find more search engines in the Frequently Asked Technical Questions that I'm quoting below. I like Jarvana but I don't have any particular recommendation:
How to find dependencies on public Maven repositories?
You could use the following search engines:
Another vote for jarvana. There are also (that I know of) mvnrepository.com and www.mvnsearch.org
You need to be careful and figure out the correct version of the jar you need. Also, the repos often have many duplicates; different names for what appears to be the same thing, so you need to figure out which one is the "real" one.