Using with Maven

March 25, 2024 ยท View on GitHub

The HTML Sanitizer is available from Maven Central

Including among your POMs <dependencies> this snippet of XML...

<dependency>
    <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
    <artifactId>owasp-java-html-sanitizer</artifactId>
    <version>20180219.1</version>
</dependency>

...will make the sanitizer available.

Be sure to change the version to a range suitable to your project. There are no unstable releases in maven. Bigger numbers are more recent and the change log can shed light on the salient differences.

You should be able to build with the HTML sanitizer. You can read the javadoc, and if you have questions that aren't answered by these wiki pages, you can ask on the mailing list.

Happy sanitizing...