[SPARK-1760]: fix building spark with maven documentation

Author: witgo <witgo@qq.com>

Closes #712 from witgo/building-with-maven and squashes the following commits:

215523b [witgo] fix building spark with maven documentation
(cherry picked from commit bd67551ee724fd7cce4f2e2977a862216c992ef5)

Signed-off-by: Patrick Wendell <pwendell@gmail.com>