如何在maven构建中激活JPAMetaModelEntityProcessor注释处理器时使用Lombok.
Maven配置:
[...]
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
[...]
Run Code Online (Sandbox Code Playgroud)
在构建过程(mvn clean install)期间,MetaModel对象生成正确,但似乎Lombok Annotation处理器不再添加到Javac编译中.所有@Getter,@ Setter,......都不起作用.