Update pom.xml and fix some bugs