For those wondering, the problem was solved by adding "exclude("META-INF/.SF", "META-INF/.DSA", "META-INF/*.RSA")" in the tasks.register("fatJar")
I was using a dependency that generated those kind of files next to the manifest and that was making the mess