#3145 enable javadoc generation for 2.1.x

A number of cherry picks, hand merges and some corrections.