我不能生成getter和setter与龙目岛

问题描述:

我开发一个项目的gradle请我的build.gradle看看:我不能生成getter和setter与龙目岛

buildscript { 
    ext { 
     springBootVersion = '1.5.7.RELEASE' 
    } 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'org.springframework.boot' 

group = 'com.support.wizard' 
version = '0.0.1-SNAPSHOT' 
sourceCompatibility = 1.8 

repositories { 
    mavenCentral() 
} 

def swaggerVersion = "2.7.0" 

dependencies { 
    compile('org.springframework.boot:spring-boot-starter-data-jpa') 
    compile('org.springframework.boot:spring-boot-starter-data-rest') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    compile('org.springframework.boot:spring-boot-starter-security') 
    compile('org.springframework.security.oauth:spring-security-oauth2') 
    compile('org.springframework.integration:spring-integration-mail') 
    compile group: 'com.sun.mail', name: 'javax.mail', version: '1.5.2' 
    compile ("io.springfox:springfox-swagger2:${swaggerVersion}") 
    compile ("io.springfox:springfox-swagger-ui:${swaggerVersion}") 
    compile("mysql:mysql-connector-java:6.0.6") 
    compileOnly('org.projectlombok:lombok') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
} 

我使用Eclipse的霓虹灯。我刷新gradle项目,但它不会为我的实体生成getter和setter。

,如:

@Entity 
@Table(name = "users") 
@Data 
@AllArgsConstructor 
@NoArgsConstructor 
public class UserEntity { 

    @Id 
    @GeneratedValue(strategy = GenerationType.IDENTITY) 
    private Long id; 

    private String email; 

    private String username; 

    private String password; 

    private String phoneNumber; 

    private String role; 

    private String resetToken; 

    private boolean enabled; 
} 

当使用Eclipse的快捷键Ctrl + O用于搜索类中的方法和字段我没有看到我的类的getter和setter UserEntity 请你有一个想法?

我找到了一个解决方案,我下载lombo罐子并双击它安装它,然后我重新启动我的日食终于清理我的项目

您需要安装龙目岛的Eclipse插件才能看到内生成的代码IDE。最简单的方法是使用任何lombok.jar中包含的安装程序(甚至可以在本地Maven或Gradle缓存中找到的安装程序);它是一个可执行的JAR。

的IntelliJ使AnnotationProcessors:

设置>构建,执行,部署>编译器>注释处理器>启用注释处理