Fix maven build.

This PR aims to fix the maven build broken by #1346.
I tried (based on the commands used by jenkins)
```
mvn -Dhadoop.version=2.0.0-mr1-cdh4.1.2 -DskipTests clean package

mvn -DHADOOP_PROFILE=hadoop-2.4 -DskipTests -Phadoop-2.4 -Pyarn -Phive clean package
```