Doing it this way, while ugly, is a necessary workaround when dealing with certain kinds of private maven repos (see GRADLE-3091). It worked well enough in 1.x, but now in 2.x it seems to be silently dropping this information, breaking support for these private maven repos.
I want to emphasize that this workaround is gross-- fixing GRADLE-3091 is a much better way to go about it. However, GRADLE-3091 has been open for 9 months and has still not been addressed. And now in 2.x we can’t even use the workaround.