spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 355 forks source link

Spring-Native conflict with spring.main.log-startup-info property in WSL #1652

Closed LtVaios closed 2 years ago

LtVaios commented 2 years ago

Although the property is set to: false (spring.main.log-startup-info=false) in my application.properties and even if you print it out it, spring still says it is set to false, the native-image logs of my app print out the spring startup-info like it is set to true. The process I am following is:

mvn clean

mvn -Pnative -DskipTests package

Run the native-image of my app in my WSL

Versions:

PS: If it has any meaning to the issue, I also tried doing the same with a very simple spring app too and this issue seems to persist.

sdeleuze commented 2 years ago

Please provide a reproducer to allow us to have a deeper look.

LtVaios commented 2 years ago

Please provide a reproducer to allow us to have a deeper look.

This app is as simple as it gets and also it includes an Application Ready Listener which logs the property's value and it appears false. Although the property is false the spring-startup-info-logs still appear after starting the spring app. You can find it in:

https://github.com/LtVaios/Spring-Rest-Service-Sample

LtVaios commented 2 years ago

Are there any updates on this issue?

sdeleuze commented 2 years ago

I can reproduce the issue, this is likely a side effect of the SpringApplication substitution defined here even if I was not able to identify exactly where this behavior come from.

But I tested this with Spring Boot 3 snapshots via https://github.com/spring-projects/spring-aot-smoke-tests which is not using anymore this substitution and it works as expected.

As we move most our efforts on Spring Boot 3 and upcoming milestone likely to provide a better native support than Spring Native itself, I will close this issue and recommend using Spring Boot 3 when available.