DOC-2399: Backport content from doc into java file and change pom to build java doc