Ben Ripkens

back to blog index

Gravatar for Java applications

Gravatar for Java (actually Gravatar4Java) is a small library for the generation of Gravatar URLs. For those readers who don’t know Gravatar - Gravatar allows you to have one avatar everywhere by uploading it to the Gravatar website. Other websites can then automatically retrieve an avatar for a user by using the email address as an identifier.

There is already a Java library around Gravatar by Ralf Ebert but it lacks some of the newer functionality like avatar over HTTPS or custom default avatars. Additionally it’s not a Maven project nor hosted on Maven Central, thus enough reasons to write my own.

The Gravatar4Java project is hosted on GitHub and already available in Maven Central (actually my first project in Maven Central)! Following is the typical Maven dependency snippet, a plain Java example and a Spring beans definition for the library.

import de.bripkens.gravatar.DefaultImage;
import de.bripkens.gravatar.Gravatar;
import de.bripkens.gravatar.Rating;

// ...

String gravatarImageURL = new Gravatar()
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

    <!-- Gravatar -->
    <bean id="gravatar"
          p:standardDefaultImage="MONSTER" />

That's me, Ben.
Hey, I am Ben Ripkens (bripkens) and this is my blog. I live in Düsseldorf (Germany) and I am employed by the codecentric AG as a Software Engineer. Web application frontends are my main area of expertise, but you may also find some other interesting articles on this blog.