Add licenses to the pom.xml and fix issues