@ConfigurationProperties in spring-boot:3.2.X does not working

264 views Asked by At

I'm testing SpringBoot 3.2.0 in a new project (created from spring's scaffold) and when I configure a @ConfigurationProperties(prefix = "some.path.to.be.parsed") class (and @ConfigurationPropertiesScan("package.to.be.scanned") to be scanned) is does not load in Spring Context, but when I try with SpringBoot>3.1.7 all works fine!

I've try with

build.gradle

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.1.X'
    id 'io.spring.dependency-management' version '1.1.4'
}

that is working fine, but in the other hand

build.gradle

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.2.X'
    id 'io.spring.dependency-management' version '1.1.4'
}

it does not load any of @ConfigurationProperties(prefix = "...") even with @ConfigurationPropertiesScan("package.to.be.scanned")

EDIT 2024-01-09:

This behavior occurs only when @ConfigurationProperties(prefix = "...") class is inside a library, but in the other hand, when @ConfigurationProperties(prefix = "...") is in the whole application, there is not this error!

I've try with -parameter flag like in this migration guide adding this configuration to my build.gradle's file

tasks.withType(JavaCompile).configureEach {
    options.compilerArgs.add("-parameters")
}

I've create this repo with the problem replication if someone want to help me

  • lib-test is published in my maven-local
  • ms-test is the "microservice" artifact that use ListsToFil class that contains @ConfigurationProperties(prefix = "app.lists-to-fill")
0

There are 0 answers