我按照
https://docs.jboss.org/hibernate/orm/5.0/topical/html/metamodelgen/MetamodelGenerator.html
休眠5.2.16.Final
Maven 3.3.9
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</plugin>
当我这样做
mvn clean generate-sources
我得到
[INFO] javac option: -proc:only
[INFO] javac option: -processor
[INFO] javac option: org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
[INFO] javac option: -d
[INFO] javac option: C:\Users\myname\git\my-repo\my-repo-domain\target\classes
[INFO] javac option: -s
[INFO] javac option: C:\Users\myname\git\my-repo\my-repo-domain\target\generated-sources\apt
[INFO] diagnostic C:\Users\myname\git\my-repo\my-repo-domain\src\main\java\me\jigar\project\domain\package\domain\repository\MyDomainRepo.java:6: error: cannot find symbol
import me.jigar.project.domain.package.domain.MyEntityClass_;
^