Find the Maven artifact that contains a class

Say you have a java project that doesn't compile because of a missing dependency:

$ mvn compile
[ERROR] /home/torstein/src/foo-app/src/main/java/com/example/[165,47] cannot access
  class file for not found

Now, how do you figure out what dependency to add to your pom.xml?

Easy, head over to:<class>

So for us here, that means hitting

Searching your local Maven repository

You can also search your local Maven repository for artifact that matches:

$ grep -r --fixed-strings ~/.m2/repository/

Licensed under CC BY Creative Commons License ~ ✉ torstein.k.johansen @ gmail ~ 🐘 ~ 🐦 @torsteinkrause