tags:

views:

45

answers:

4

In general, what is the best strategy for finding the groupId and artifactId for a well-known dependency for use in a Maven POM? For example, how would I find the correct entry for the MySQL JDBC driver? It's not mentioned on the mysql.com site, so I would usually spend time looking for another POM that already uses the Maven repository version of the jar. This can't be the best way.

+1  A: 

Most of the time my IDE does this for me. But when I'm not sure I search manually; Google really helps.

You can also search on maven search engines like this mavensearch.net, jarvana.com or mvnrepository.com.

Colin Hebert
+3  A: 

M2Eclipse, the maven integration of eclipse, supports local searchable indexes of maven repositories. So you can right-click a project or a pom.xml and do

Maven -> Add Dependency

A dialog appears where you can search for artifacts from your local indexes. Wouldn't want to miss it.

If that's not an option, use mvnrepository.com

seanizer
+1  A: 

In my experience the best option is mvnrepository.com. for example in your case, just type mysql in the search text field. you will find all available artifacts that contain mysql string. in your case the one fit your needs is: mysql-connector-java for each artifact you have a general description that helps you decide what is best for you. once you click it you get all the available versions and once you click on a version you have all sort of information about it like the code you need to add to your pom.xml, the artifact dependencies and so on...

rperez
+1  A: 

I use http://repository.sonatype.org.

tunaranch