title: Jackson module not registered after update to Spring Boot 2
body: <p>I'm as upgrading from Spring Boot 1.5.21 to 2.2.5.</p>
  
  <p>I need to use <code>MonetaryModule</code> to deserialize rest calls, and depending on Spring's <code>ObjectMapper</code>.</p>
  
  <p>I have defined such a bean for this module in a some <code>@Configuration</code> class (<code>MonetaryModule</code> is extending <code>Module</code>):</p>
  
  <pre><code>@Bean
  public MonetaryModule monetaryModule() {
      return new MonetaryModule();
  }
  </code></pre>
  
  <p>I can see in <code>/beans</code> endpoint it was created. However, it is not actually loaded to <code>ObjectMapper</code>. After a lot of debugging and digging around Spring's code, I came to the conclusion that there is something wrong in <code>JacksonAutoConfiguration</code>. it has an inner static class called <code>JacksonObjectMapperBuilderConfiguration</code> and in it there's a <code>bean</code> that creates the <code>Jackson2ObjectMapperBuilder</code>. in the creation process, there's a call to <code>customize()</code> that eventually gets to this code:</p>
  
  <pre><code>private void configureModules(Jackson2ObjectMapperBuilder builder) {
      Collection&lt;Module&gt; moduleBeans = getBeans(this.applicationContext, Module.class);
      builder.modulesToInstall(moduleBeans.toArray(new Module[0]));
  }
  </code></pre>
  
  <p>This code seems responsible for loading the modules into <code>ObjectMapper</code>, Problem is that this <code>Jackson2ObjectMapperBuilder</code> is not actually created. It appears in <code>/beans</code> endpoint but de facto when I breakpoint there I'm not hitting the breakpoint. This explains why the module is not loaded into <code>ObjectMapper</code>. </p>
  
  <p>Question is, why is this code not being called? and why <code>/bean</code> indicates the bean does exist?</p>
  
  <p>Edit - Adding conditions evaluation report:</p>
  
  <pre><code>============================
  CONDITIONS EVALUATION REPORT
  ============================
  
  
  Positive matches:
  -----------------
  
     AopAutoConfiguration matched:
        - @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)
  
     AopAutoConfiguration.AspectJAutoProxyingConfiguration matched:
        - @ConditionalOnClass found required class 'org.aspectj.weaver.Advice' (OnClassCondition)
  
     AopAutoConfiguration.AspectJAutoProxyingConfiguration.CglibAutoProxyConfiguration matched:
        - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)
  
     ConfigServiceBootstrapConfiguration#configServicePropertySource matched:
        - @ConditionalOnProperty (spring.cloud.config.enabled) matched (OnPropertyCondition)
        - @ConditionalOnMissingBean (types: org.springframework.cloud.config.client.ConfigServicePropertySourceLocator; SearchStrategy: all) did not find any beans (OnBeanCondition)
  
     ConfigServiceBootstrapConfiguration.RetryConfiguration matched:
        - @ConditionalOnClass found required classes 'org.springframework.retry.annotation.Retryable', 'org.aspectj.lang.annotation.Aspect', 'org.springframework.boot.autoconfigure.aop.AopAutoConfiguration' (OnClassCondition)
        - @ConditionalOnProperty (spring.cloud.config.fail-fast) matched (OnPropertyCondition)
  
     ConfigServiceBootstrapConfiguration.RetryConfiguration#configServerRetryInterceptor matched:
        - @ConditionalOnMissingBean (names: configServerRetryInterceptor; SearchStrategy: all) did not find any beans (OnBeanCondition)
  
     ConfigurationPropertiesRebinderAutoConfiguration matched:
        - @ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition)
  
     ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched:
        - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition)
  
     ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched:
        - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition)
  
     EncryptionBootstrapConfiguration matched:
        - @ConditionalOnClass found required class 'org.springframework.security.crypto.encrypt.TextEncryptor' (OnClassCondition)
  
     PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
        - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)
  
  
  Negative matches:
  -----------------
  
     AopAutoConfiguration.AspectJAutoProxyingConfiguration.JdkDynamicAutoProxyConfiguration:
        Did not match:
           - @ConditionalOnProperty (spring.aop.proxy-target-class=false) did not find property 'proxy-target-class' (OnPropertyCondition)
  
     AopAutoConfiguration.ClassProxyingConfiguration:
        Did not match:
           - @ConditionalOnMissingClass found unwanted class 'org.aspectj.weaver.Advice' (OnClassCondition)
  
     DiscoveryClientConfigServiceBootstrapConfiguration:
        Did not match:
           - @ConditionalOnProperty (spring.cloud.config.discovery.enabled) did not find property 'spring.cloud.config.discovery.enabled' (OnPropertyCondition)
  
     EncryptionBootstrapConfiguration.RsaEncryptionConfiguration:
        Did not match:
           - Keystore nor key found in Environment (EncryptionBootstrapConfiguration.KeyCondition)
        Matched:
           - @ConditionalOnClass found required class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)
  
     EncryptionBootstrapConfiguration.VanillaEncryptionConfiguration:
        Did not match:
           - @ConditionalOnMissingClass found unwanted class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)
  
  
  Exclusions:
  -----------
  
      None
  
  
  Unconditional classes:
  ----------------------
  
      None
  </code></pre>
  
  <p>Also, attached is the output of <code>/conditions</code> &amp; <code>/beans</code> endpoints output (Too large to paste into the post itself)</p>
  
  <p><a href="https://gofile.io/d/IWDtMd" rel="nofollow noreferrer">endpoints output</a></p>