Skip to content

Commit 16fdea7

Browse files
pcoates33maibin
authored andcommitted
BAEL-2721 Moved JsonAliasUnitTest into new module called jackson-2. (eugenp#6555)
* BAEL-2721 Examples of @JsonAlias and Gson's alternate parameter * BAEL-2721 Update class and method names for JsonAlias and GsonAlternate * BAEL-2721 move JsonAliasUnitTest into new jackson-2 module * BAEL-2721 Removed unused dependencies from pom.xml * BAEL-2721 Tidy up logback.xml * BAEL-2721 fix url in README.md
1 parent 10e9cbd commit 16fdea7

8 files changed

Lines changed: 91 additions & 0 deletions

File tree

gson/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
- [Convert JSON to a Map Using Gson](https://www.baeldung.com/gson-json-to-map)
1212
- [Working with Primitive Values in Gson](https://www.baeldung.com/java-gson-primitives)
1313
- [Convert String to JsonObject with Gson](https://www.baeldung.com/gson-string-to-jsonobject)
14+
- [Mapping Multiple JSON Fields to One Java Field](https://www.baeldung.com/json-multiple-fields-single-java-field)
15+

jackson-2/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.class
2+
3+
#folders#
4+
/target
5+
/neoDb*
6+
/data
7+
/src/main/webapp/WEB-INF/classes
8+
*/META-INF/*
9+
10+
# Packaged files #
11+
*.jar
12+
*.war
13+
*.ear

jackson-2/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=========
2+
3+
## Jackson Cookbooks and Examples
4+
5+
###The Course
6+
The "REST With Spring" Classes: http://bit.ly/restwithspring
7+
8+
### Relevant Articles:
9+
- [Mapping Multiple JSON Fields to One Java Field](https://www.baeldung.com/json-multiple-fields-single-java-field)

jackson-2/pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>jackson-2</artifactId>
5+
<version>0.1-SNAPSHOT</version>
6+
<name>jackson-2</name>
7+
8+
<parent>
9+
<groupId>com.baeldung</groupId>
10+
<artifactId>parent-java</artifactId>
11+
<version>0.0.1-SNAPSHOT</version>
12+
<relativePath>../parent-java</relativePath>
13+
</parent>
14+
15+
<dependencies>
16+
17+
<!-- marshalling -->
18+
19+
<dependency>
20+
<groupId>com.fasterxml.jackson.core</groupId>
21+
<artifactId>jackson-databind</artifactId>
22+
<version>${jackson.version}</version>
23+
</dependency>
24+
25+
26+
<!-- test scoped -->
27+
28+
<dependency>
29+
<groupId>org.assertj</groupId>
30+
<artifactId>assertj-core</artifactId>
31+
<version>${assertj.version}</version>
32+
<scope>test</scope>
33+
</dependency>
34+
</dependencies>
35+
36+
<build>
37+
<finalName>jackson-2</finalName>
38+
<resources>
39+
<resource>
40+
<directory>src/main/resources</directory>
41+
<filtering>true</filtering>
42+
</resource>
43+
</resources>
44+
</build>
45+
46+
<properties>
47+
48+
<!-- testing -->
49+
<assertj.version>3.11.0</assertj.version>
50+
</properties>
51+
52+
</project>

jackson/src/main/java/com/baeldung/jackson/entities/Weather.java renamed to jackson-2/src/main/java/com/baeldung/jackson/entities/Weather.java

File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6+
</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<root level="INFO">
11+
<appender-ref ref="STDOUT" />
12+
</root>
13+
</configuration>

jackson/src/test/java/com/baeldung/jackson/deserialization/jsonalias/JsonAliasUnitTest.java renamed to jackson-2/src/test/java/com/baeldung/jackson/deserialization/jsonalias/JsonAliasUnitTest.java

File renamed without changes.

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@
436436
<module>immutables</module>
437437

438438
<module>jackson</module>
439+
<module>jackson-2</module>
439440
<module>java-collections-conversions</module>
440441
<module>java-collections-maps</module>
441442
<!-- <module>java-dates</module> --> <!-- We haven't upgraded to java 9. Fixing in BAEL-10841 -->
@@ -1078,6 +1079,7 @@
10781079
<module>immutables</module>
10791080

10801081
<module>jackson</module>
1082+
<module>jackson-2</module>
10811083
<module>java-collections-conversions</module>
10821084
<module>java-collections-maps</module>
10831085
<!-- <module>java-dates</module> --> <!-- We haven't upgraded to java 9. Fixing in BAEL-10841 -->

0 commit comments

Comments
 (0)