0

Does spring-boot-configuration-processor process annotated bean methods? Because in my case, it doesn't.

Here is my code:

@Data
public class DatasourceConnectionPoolProperties {
  private Integer initialSize;
  private Integer maxIdle;
  private Integer minIdle;
  private Integer timeBetweenEvictionRunsMillis;
  private Integer minEvictableIdleTimeMillis;
  private Boolean testOnBorrow;
  private String validationQuery;
}

And somewhere in @Configuration-annotated class:

@Bean
@ConfigurationProperties("persistence.pool")
protected DatasourceConnectionPoolProperties localPoolProperties() {
  return new DatasourceConnectionPoolProperties();
}

During compilation, no metadata generated. But, when DatasourceConnectionPoolProperties gets annotated with @ConfigurationProperties metadata generated.

Did I make mistake somewhere, or it's just spring-boot-configuration-processor limitations?

Vsevolod Poletaev
  • 1,482
  • 1
  • 12
  • 13

1 Answers1

3

It does but the annotation processor only looks for public method and yours is protected (which is very unusual for a @Bean method by the way).

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89