The Sweble Wikitext Components module provides a parser for MediaWiki's wikitext and an engine trying to emulate the behavior of a MediaWiki.
This library is published on Maven Central. You can use it by adding the following Maven coordinates to your project:
<dependency>
<groupId>org.sweble.wikitext</groupId>
<artifactId>swc-parser-lazy</artifactId>
<version>3.1.9</version>
</dependency>
This module exposes the wikitext parser itself, other Maven modules are available as well.
You first need to clone the sweble/osr-common repository, and then clone this repository inside it, as the tooling/sweble-wikitext
local directory.
You can then work on this library as a Maven project.