title: Strange compilation error with Maven
body: <p>I have a project A that depends on project B that depends on project C. Project C depends on Hibernate (more precisely org.hibernate:hibernate-core:3.6.8.Final). Project B doesn't depend on the hibernate artifact. But, project A depends on this artifact but only for unit tests, so I use test scope. When I try to build A, projects C and B are correctly built and installed but I get the following error during A compilation:</p>
  
  <blockquote>
    <p>Failure executing javac, but could not parse the error:
    myPackage\MyClass.class(myPackage:MyClass.class): warning: Cannot find
    annotation method 'value()' in type
    'org.hibernate.annotations.Cascade': class file for
    org.hibernate.annotations.Cascade not found An exception has occurred
    in the compiler (1.6.0_27). 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.CascadeType not found</p>
  </blockquote>
  
  <p>I precise that MyClass belongs to project C and imports org.hibernate.annotations.Cascade. And C compiles successfully so it can find the said class.
  But here, it seems that the class file cannot be found during A compilation. I thought that maybe the test-scoped dependency on Hibernate may cancel the Hibernate dependency of C? But, I have no idea.</p>
  
  <p>Also, if I change the scope of the dependency in project A from test to compile, the problem disappears.</p>
  
  <p>Thanks for your help</p>