Tolerate removal of JacksonJodaFormat in Jackson 2.5

We currently officially support Jackson 2.4, but some users wish to
use Jackson 2.5. This causes a failure as JacksonAutoConfiguration
depends on JacksonJodaFormat which exists in 2.4 but not in 2.5. This
commit updates JodaDataTimeJacksonConfiguration to make it conditional
on JacksonJodaFormat being on the classpath. This means that Jackson
2.5 users will not have configurable DateTime formatting
(added in 201fb5e5) but things will generally work once again.

Closes gh-2573
pull/2707/merge
Andy Wilkinson 10 years ago
parent e927f52f26
commit 71dde3ec89

@ -106,7 +106,7 @@ public class JacksonAutoConfiguration {
@Configuration @Configuration
@ConditionalOnClass({ Jackson2ObjectMapperBuilder.class, DateTime.class, @ConditionalOnClass({ Jackson2ObjectMapperBuilder.class, DateTime.class,
DateTimeSerializer.class }) DateTimeSerializer.class, JacksonJodaFormat.class })
static class JodaDateTimeJacksonConfiguration { static class JodaDateTimeJacksonConfiguration {
private final Log log = LogFactory.getLog(JodaDateTimeJacksonConfiguration.class); private final Log log = LogFactory.getLog(JodaDateTimeJacksonConfiguration.class);

Loading…
Cancel
Save