DEV Community

Rabinarayan Patra
Rabinarayan Patra

Posted on • Originally published at rabinarayanpatra.com on

Sanitizer-Lib is Now Live on Maven Central

It's official: Sanitizer-Lib is now available on Maven Central! 🚀

A few months ago, I introduced Sanitizer-Lib, a Java library designed to kill the boilerplate of input sanitization. No more manual .trim() calls, no more scattered string manipulation logic. Just clean, declarative annotations.

Since then, the feedback has been amazing. But there was one friction point: you had to use JitPack or build it locally.

Not anymore.

As of today, you can pull Sanitizer-Lib directly from Maven Central. It's production-ready, signed, and just a copy-paste away.

How do you add Sanitizer-Lib to your Maven or Gradle project?

Maven

Add this to your pom.xml:

<dependency>
    <groupId>io.github.rabinarayanpatra.sanitizer</groupId>
    <artifactId>sanitizer-spring</artifactId>
    <version>1.0.22</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

Gradle

Add this to your build.gradle:

implementation("io.github.rabinarayanpatra:sanitizer-spring:1.0.22")
Enter fullscreen mode Exit fullscreen mode

What problems does Sanitizer-Lib solve that manual validation doesn't?

If you missed the original deep dive, here is the 30-second pitch:

Instead of writing this validation spaghetti:

public void createUser(UserDto user) {
    if (user.getEmail() != null) {
        user.setEmail(user.getEmail().trim().toLowerCase());
    }
    // ... repeat for 10 other fields
}
Enter fullscreen mode Exit fullscreen mode

You just do this:

public class UserDto {
    @Sanitize(using = {TrimSanitizer.class, LowerCaseSanitizer.class})
    private String email;
}
Enter fullscreen mode Exit fullscreen mode

That's it. Incoming requests are automatically sanitized before they even hit your controller logic.

What changed from JitPack to Maven Central?

Publishing to Maven Central means:

  • No extra repository configuration — Maven Central is the default repository for every Maven and Gradle project
  • Signed artifacts — All JARs are GPG-signed, ensuring you're getting the authentic library
  • Reliable availability — Maven Central has 99.99% uptime, unlike JitPack which can have intermittent issues
  • Better IDE support — IntelliJ and Eclipse resolve Maven Central dependencies faster

Migration from JitPack

If you were using Sanitizer-Lib via JitPack, here's what to change:

  1. Remove the JitPack repository from your pom.xml or build.gradle
  2. Update the group ID from com.github.rabinarayanpatra to io.github.rabinarayanpatra.sanitizer
  3. Update to the latest version (1.0.22)

The API remains 100% backward compatible — no code changes required.

Where can you learn more about Sanitizer-Lib?

For a full walkthrough of features, custom sanitizers, and Spring Boot integration, check out my detailed guide:

Read the Full Sanitizer-Lib Introduction

Or star the repo on GitHub: github.com/rabinarayanpatra/sanitizer-lib

For more information, see the Maven Central Repository Search and the Sonatype OSSRH Publishing Guide.

Keep Reading

Happy coding!

Top comments (0)