I have a multi module Maven based web application project with a hibernate-annotations dependency that was failing to compile. I was getting the compilation error below:

[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
An exception has occurred in the compiler (1.6.0_22). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.hibernate.annotations.CacheConcurrencyStrategy not found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------

Changing the dependency scope from provided to compile fixed the issue, but that would add unnecessary jars in the EAR that are already provided by the server, causing classloading errors on JBoss.

It turns out maven-compiler-plugin 2.3.2 has a bug, switching to 2.1 solves the issue.

Other modules that depend on the module with hibernate-annotations dependency will also have to explicity add hibernate-annotation dependency as provided.