Using PMD.run() inside multiple threads give erratic and non-deterministic results, randomly printing nothing, printing "null", printing help or working fine. Synchronizing the threads solves the problem which shows that the run() call uses some shared resource. But since the run() method is static, this shouldn't happen.
See https://sourceforge.net/p/pmd/discussion/188194/thread/43d3c474/
I found one problem - the JCommander instance that is used to parse the command line arguments was shared. This will be fixed with PMD 5.1.
In case, you still experience a problem using PMD.run() inside multiple threads, please let me know.
Thanks,
Andreas