How to search the Maven coordinates – pom.xml dependency?

If you want to include a library dependency in “pom.xml” file, you have to define the “Maven coordinate


<!-- MySQL database driver -->
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>5.1.9</version>
</dependency>

However, one of the annoying problem of this is you do not know what’s the Maven coordinate details – group id, artifactId and etc. Many Java developers just browse the Maven central repository and search for it. If the dependency library is package in a deep folder structure, you may have problem in digging work.

Maven coordinates workaround

Here’s a dirty workaround it – Google site search Maven repository. The Google search function is powerful enough to find the Maven’s coordinate for you.

Let say, you want to know the “logback” Maven’s coordinates , you can search it in Google with search text


logback site:http://repo1.maven.org/maven2/

Google will return the result.


http://repo1.maven.org/maven2/ch/qos/logback/

I really hope Maven can provide a search function in the Maven repository in future.

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
MohitKaushik
11 years ago

gtko take my thanks too, this was really needed info for me too ……..

OAKTech
12 years ago

For example, navigate to http://search.maven.org/ and enter in the search box, g:”commons-dbcp” AND a:”commons-dbcp”. You can then click the pom link and get the info you need.

gtko
14 years ago

Use the search mechanism here – http://mvnrepository.com/

For instance, in the search bar
1) Type Log4j

This displays links to “Apache Log4j” and “SLF4J LOG4J-12 Binding”
2) Click on the Apache Log4j link and select the version you want.

This will display the coordinates for Mave, Ivy, Gradle, etc.

Satish
14 years ago

Thank you for providing such helpful information

http://search.maven.org

I think this site is the search provided by maven.