Sonarqube 使用Lombok@Setter(value=AccessLevel.PRIVATE)的声纳错误wehn
如果我在值为PRIVATE的字段上使用Lombok@Setting注释Sonarqube 使用Lombok@Setter(value=AccessLevel.PRIVATE)的声纳错误wehn,sonarqube,lombok,Sonarqube,Lombok,如果我在值为PRIVATE的字段上使用Lombok@Setting注释 @Data @AllArgsConstructor @NoArgsConstructor public class Notification implements Serializable { private static final long serialVersionUID = 1L; @Id @Setter(value = AccessLevel.PRIVATE) private S
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Notification implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Setter(value = AccessLevel.PRIVATE)
private String id;
private long userId;
private Event event;
private long timestamp = System.currentTimeMillis();
public Notification(final String id) {
this.id = id;
}
}
Sonar Maven插件出现以下错误:
ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mio-events: Unable to analyze .class file tv/nativ/mio/event/model/Notification: 0 is not a valid line for a file -> [Help 1]
将@Setting值更改为public可以解决此问题,同时删除@Setting并为字段添加手动私有setter也可以解决此问题
知道问题是什么吗
谢谢
尼克声纳并不真正支持龙目羚:
在运行sonar之前,您应该清除源并使用生成的源进行分析。有关此操作的信息,请参见以下页面:。如果您使用的是maven,这里有一个使用此技术的示例:您能提供stacktrace吗?我认为您正面临这个问题:SonarJava插件3.7.1即将发布一个错误修复版本。