Migrate from old-style legacy .java provider to the new JavaInfo.
Migrate from old-style legacy .java provider to the new JavaInfo.

This is a rollforward of https://gerrit-review.googlesource.com/c/gerrit/+/234154
with a bug fix.

I checked the bug is now fixed by building :gerrit at head, with the
faulty (rolledback) change and with the current change. I compared the war files
contents: the ones built at head and with this change are the same, the
ones built at head and with the rolledback change differ a lot.

Change-Id: I1d5afb8b022b33f110ed1006fcfcd6fc7aa97d71

GerritCodeReview/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,WANdisco/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit