无法将类 com.example.dockertest.entity.Account中的构造器 Account应用到给定类型:
·
无法将类 com.example.dockertest.entity.Account中的构造器 Account应用到给定类型:
先只加了下面内容,编译通过,发现编译后的内容没有set和get,是lombok注解没有生效
// 手动添加无参构造器(JPA 必须)
public Account() {
}
// 手动添加全参构造器(和字段顺序一致)
public Account(long id, String name, String password) {
this.id = id;
this.name = name;
this.password = password;
}
}
每个服务Annotation Processors也勾选上Enable annotation processing和Obtain processors from project classpath
最后在pom.xml添加,成功
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
更多推荐

所有评论(0)