Skip to content

Commit

Permalink
Update jackson to version 2.8.9 and remove depreceiated modules
Browse files Browse the repository at this point in the history
Update corrects jacksons JXAB xml compatibility.
See FasterXML/jackson-dataformat-xml#178 for
details.

refs #11207
  • Loading branch information
KevinCaseiras committed Jul 25, 2017
1 parent 9abff3f commit 5a057ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<guava.version>18.0</guava.version>
<hamcrest.version>1.3</hamcrest.version>
<hierarchicalcontextrunner.version>4.12.1</hierarchicalcontextrunner.version>
<jackson.version>2.5.4</jackson.version>
<jackson.version>2.8.9</jackson.version>
<jstl.version>1.2</jstl.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
Expand Down Expand Up @@ -196,12 +196,6 @@
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/gov/nysenate/ess/core/config/JacksonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import com.fasterxml.jackson.datatype.jsr310.JSR310Module;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -28,7 +28,9 @@ public ObjectMapper jsonObjectMapper() {
*/
@Bean
public ObjectMapper xmlObjectMapper() {
ObjectMapper objectMapper = new XmlMapper();
JacksonXmlModule module = new JacksonXmlModule();
module.setDefaultUseWrapper(false);
ObjectMapper objectMapper = new XmlMapper(module);
configureMapper(objectMapper);
return objectMapper;
}
Expand All @@ -42,7 +44,6 @@ private void configureMapper(ObjectMapper objectMapper) {
objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.registerModule(new GuavaModule());
objectMapper.registerModule(new JSR310Module());
objectMapper.registerModule(new JaxbAnnotationModule());
}
}

0 comments on commit 5a057ce

Please sign in to comment.