Comes from this commit: 085789089bf301b7a08dab79c7355be372b66b11
This was to solve the following use case.

Often you will have a msg package deb installed and a source workspace running on top which is working on a development (bumped) version of the sources. In this case the java generation code is going to find two packages with the same name and it has no intelligent heuristic for choosing which package will be selected (I can't recall off the top of my head, but it ignores the ROS_PACKAGE_PATH sequence as well). This often results in generation of the deb message package, not the new sources. With the gradle plugin telling it where to look it can guarantee we get the new sources. It also provides a considerable speedup when calling the generator on a single package at a time (we use quite alot for unofficial java messages).

This is pretty important for us - otherwise we have to uninstall debs to do development on unstable sources, and then install the debs to do development on release resources. Very annoying.