Refactor pom.xml file: dynamic web recognition, add missing dependencies