我正在玩 Spring Boot 2.0.0M2,试图创建一个 CLI 应用程序,而不是 Web 应用程序。我的问题是,即使包括
compile 'org.springframework.boot:spring-boot-starter'
compile 'org.springframework.boot:spring-boot-starter-json'
在我的构建中,ObjectMapper 不是由 Boot 创建的,因为
Bean method 'jacksonObjectMapper' not loaded because @ConditionalOnClass did not find required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'
当您想要拥有 Spring Boot 实例并配置 Jackson 但不想启动 Web 服务器时,最佳实践是什么?