compatible with java 5 and ignore target dir