Which Jackson maven dependencies to include in spring 3.1 project for JAXB JSON marshalling?
13,571
Solution 1
The main difference i can see is the license.
The first option uses jackson-mapper-asl
which uses the apache license, while the second one uses the lgpl license. so it is really a matter of legal.
see here.
Solution 2
Use this dependency in your pom.xml file.
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.0</version>
</dependency>
Comments
-
Jérôme Verstrynge almost 2 years
In the code sample available here, one imports the following for JSON JAXB marshalling:
<dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.5.3</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>3.1.0.RELEASE</version> </dependency>
Yet, this blog post, referring to this blog post, suggests:
<!-- Jackson --> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-lgpl</artifactId> <version>1.3.0</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-lgpl</artifactId> <version>1.3.0</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-xc</artifactId> <version>1.3.0</version> </dependency>
where 'jackson-xc provides the additional Jaxb support'.
What is the difference between both set of maven dependencies when it comes to JAXB JSON marhsalling in Spring? Which one should be used preferably?