Closed enderwsp closed 2 years ago
Hi, thanks for raising this issue, there is indeed maybe a limitation in Spring Native support on that. Since we have moved most of our effort into Spring Boot 3 native support, could you please try the same use case with Spring Boot 3 snapshot, and create an issue on Spring Boot issue tracker with a repro if that is not supported?
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
first ,clone from https://github.com/spring-projects-experimental/spring-native
second ,go to the path main/samples/boot-features
then ,exe build.sh
default demo is ok,
but,in my project ,i need define class with @ConfigurationProperties in dependent jar
so ,i move follow class to a new dependent project ,[com.example:boot-features-dep:0.0.1-SNAPSHOT] https://github.com/spring-projects-experimental/spring-native/blob/main/samples/boot-features/src/main/java/com/example/bootfeatures/Creds.java exe mvn clean install in project boot-features-dep
add dependency [com.example:boot-features-dep:0.0.1-SNAPSHOT] into follow pom https://github.com/spring-projects-experimental/spring-native/blob/main/samples/boot-features/pom.xml
then re run build.sh
i can get bin [./target/boot-features] but will get error when exe it: GenericApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'CLR': Unsatisfied dependency expressed through field 'credentials'; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'credentials-com.example.bootfeaturesjar.Creds': Could not bind properties to 'Creds' : prefix=credentials, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'credentials' to com.example.bootfeaturesjar.Creds