我认为您正在遇到Maven错误,或者最好是编译器插件MCOMPILER-66中的错误。当涉及注释处理时,编译器插件有几个问题,例如MCOMPILER-62。真正的最佳选择imo是禁用编译器插件的注释处理,并使用
maven-processor-plugin
。在此博客文章中,您可以了解如何使用它。看起来像这样:
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <compilerArgument>-proc:none</compilerArgument> </configuration> </plugin> <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId> <version>1.3.7</version> <executions> <execution> <id>process</id> <goals> <goal>process</goal> </goals> <phase>process-sources</phase> </execution> </executions> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-jpamodelgen</artifactId> <version>1.1.0.Final</version> <scope>compile</scope> </dependency> </dependencies> </plugin>
还要注意注释处理器的依赖关系如何很好地仅限于插件。



