Search code examples
jsonspringapplication.properties

Why spring boot scanBasePackages conflict with spring.jackson.date-format


I config the json date format in application.properties with annotation

//in application.properties
spring.jackson.date-format=yyyy-MM-dd

@SpringBootApplication(scanBasePackages = (arrayOf("com.khidi")))

the json date format not working,but I remove scanBasePages, it's working. I need set the scanBasePages, because some bean in another package, how to fix it. thx.


Solution

  • I found that a piece of code conflict the config

    @Configuration
    class CustomRepositoryRestMvcConfiguration : RepositoryRestMvcConfiguration() {
    
    }