My problem wasn't exactly producing a fat jar, but more having all the modules to have its own jar. At the beginning, I wanted to publish a single module using maven-publish plugin but maven wasn't picking up the other modules code when producing the jar, then I figured out that I should publish the whole project and not just one module and get a jar for every source set. That way it worked.