title: Is it possible to have Jackson ObjectMapper to obey JAXB XML annotations in a Spring Boot application?
body: <p>Having a <a href="/questions/tagged/spring-boot" class="post-tag" title="show questions tagged &#39;spring-boot&#39;" rel="tag">spring-boot</a> application using <a href="/questions/tagged/jackson" class="post-tag" title="show questions tagged &#39;jackson&#39;" rel="tag">jackson</a> <code>ObjectMapper</code> I am using the following pattern to have a <code>List</code> field serialized nicely:</p>
  
  <pre><code>@JacksonXmlProperty(localName = "item")
  @JacksonXmlElementWrapper(useWrapping = true, localName = "items")    
  private List&lt;Item&gt; items;
  </code></pre>
  
  <p>so to get something like:</p>
  
  <pre><code>&lt;items&gt;
     &lt;item&gt;...&lt;/item&gt;
     &lt;item&gt;...&lt;/item&gt;
     ...
  &lt;/items&gt;
  </code></pre>
  
  <p>I have studied - without any luck - how it would be possible to use <a href="/questions/tagged/jaxb" class="post-tag" title="show questions tagged &#39;jaxb&#39;" rel="tag">jaxb</a> annotations like <code>@XmlElementWrapper</code> to achieve this.</p>
  
  <p>Is there - for example - something I can do with <code>JacksonConfiguration</code>?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Adding</p>
  
  <pre><code>objectMapper.registerModule(new JaxbAnnotationModule());
  </code></pre>
  
  <p>to Spring JacksonConfiguration and annotating like:</p>
  
  <pre><code>@XmlElementWrapper
  @XmlElement(name="item")
  private List&lt;Item&gt; items;
  </code></pre>
  
  <p>does not work as expected. I am currently investigating possibility to replace Jackson with GSON as done in <a href="https://stackoverflow.com/q/40786366/6413377">this post</a></p>
  
  <p>I would really like to have this annotation stuff to be generic so not just <a href="/questions/tagged/jackson" class="post-tag" title="show questions tagged &#39;jackson&#39;" rel="tag">jackson</a> specific or like adding annotations per serializer implementation.</p>