Sanitizer-Lib is Now Live on Maven Central
Writing
JAVA LIBRARIES
December 9, 20253 min read

Sanitizer-Lib is Now Live on Maven Central

Great news for Java developers! Sanitizer-Lib, the library that eliminates input sanitization boilerplate, is now officially available on Maven Central. Here is how to add it to your project.

javamaven-centralopen-sourceclean-codeannouncement

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>

Gradle

Add this to your build.gradle:

implementation("io.github.rabinarayanpatra:sanitizer-spring:1.0.22")

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
}

You just do this:

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

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!

Frequently Asked Questions

How do I add Sanitizer-Lib to my project from Maven Central?

Add the dependency with groupId 'io.github.rabinarayanpatra.sanitizer' and artifactId 'sanitizer-spring' to your pom.xml or build.gradle. No extra repository configuration is needed since Maven Central is the default repository.

What changed when Sanitizer-Lib moved from JitPack to Maven Central?

The API is 100% backward compatible. The main changes are: the group ID changed from 'com.github.rabinarayanpatra' to 'io.github.rabinarayanpatra.sanitizer', you no longer need the JitPack repository in your build file, and all artifacts are now GPG-signed.

Last updated: April 2, 2026

Rabinarayan Patra

Rabinarayan Patra

SDE II at Amazon. Previously at ThoughtClan Technologies building systems that processed 700M+ daily transactions. I write about Java, Spring Boot, microservices, and the things I figure out along the way. More about me β†’

X (Twitter)LinkedIn

Stay in the loop

Get the latest articles on system design, frontend & backend development, and emerging tech trends β€” straight to your inbox. No spam.