How to make javac squawk for incorrect package names in Java source files
<p>Today, I ran into a java source file that had a typo in the 'package' statement at the top. The name of the package did not match the name of the directory the file was sitting in (one extra 's' at the end).</p>

<p>To my surprise, javac from 1.6, checkstyle, and pmd all passed the file as OK. The only tool that got around to complaining was javadoc, and only because it was the only file in the package, and a package with no classes in it is a fatal error to javadoc.</p>

<p>Is there some option to javac, or some other command-line tool (preferably with a maven plugin maven) that will squeal about this sort of goof?</p>
