We are using project lombok for setters and getters and we prefer fluent accessors for setter & getters . The problem arises when we use ConfigurationProperties with fluent accessors. Spring is not able to wire the properties with the class fields . The same things works when we remove the Accessor annotation and have the classic setters and getters. Is there a way we can use custom setters with Configurationproperties
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties
@Data
@Accessors(fluent = true)
public class Properties {
private String property1;
private String property2;
}
We get a null pointer exception while accessing this property as
properties.property1()