Use template form of mktemp. Improve pom/jar determination