diff --git a/jackson-annotations/README.md b/jackson-annotations/README.md
new file mode 100644
index 0000000000..d979ec0e0e
--- /dev/null
+++ b/jackson-annotations/README.md
@@ -0,0 +1,11 @@
+## Jackson Annotations
+
+This module contains articles about Jackson annotations.
+
+### Relevant Articles:
+- [Guide to @JsonFormat in Jackson](https://www.baeldung.com/jackson-jsonformat)
+- [More Jackson Annotations](https://www.baeldung.com/jackson-advanced-annotations)
+- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations)
+- [Jackson – Bidirectional Relationships](https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion)
+- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property)
+- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization)
diff --git a/jackson-annotations/pom.xml b/jackson-annotations/pom.xml
new file mode 100644
index 0000000000..b3efc51e62
--- /dev/null
+++ b/jackson-annotations/pom.xml
@@ -0,0 +1,60 @@
+
+ 4.0.0
+ jackson-annotations
+ 0.0.1-SNAPSHOT
+ jackson-annotations
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../parent-java
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jsonSchema
+ ${jackson.version}
+
+
+ io.rest-assured
+ json-path
+ ${rest-assured.version}
+ test
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+
+
+ jackson-annotations
+
+
+ src/main/resources
+ true
+
+
+
+
+
+ 3.11.0
+ 3.1.1
+
+
+
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/AliasBean.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/AliasBean.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/AliasBean.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/AliasBean.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithCreator.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithCreator.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithFilter.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithFilter.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithGetter.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithGetter.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithIgnore.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithIgnore.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithInject.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/BeanWithInject.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/ExtendableBean.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/ExtendableBean.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/MyBean.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/MyBean.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/MyBean.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/PrivateBean.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/PrivateBean.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/RawBean.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/RawBean.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/RawBean.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/RawBean.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/UnwrappedUser.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/UnwrappedUser.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/annotation/Zoo.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/Zoo.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/annotation/Zoo.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/Zoo.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java
similarity index 91%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java
index 25de4a8f7a..acd68e9e4a 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java
similarity index 86%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java
index 910ccec174..a71bdd57f8 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
public class ItemWithIgnore {
public int id;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithRef.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java
similarity index 88%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithRef.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java
index 0ca8d721e8..3b9bb44c37 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithRef.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
import com.fasterxml.jackson.annotation.JsonManagedReference;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIdentity.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java
similarity index 93%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIdentity.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java
index db83a09389..9703b27f3e 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIdentity.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
import java.util.ArrayList;
import java.util.List;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIgnore.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java
similarity index 91%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIgnore.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java
index 857a373cc5..19598a4c17 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithIgnore.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
import java.util.ArrayList;
import java.util.List;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithRef.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java
similarity index 91%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithRef.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java
index 3de03fc651..3d844ea6c0 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithRef.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.bidirection;
+package com.baeldung.jackson.annotation.bidirection;
import java.util.ArrayList;
import java.util.List;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateDeserializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java
similarity index 95%
rename from jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateDeserializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java
index 90c7d9fbac..f17c4dc0dd 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateDeserializer.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.date;
+package com.baeldung.jackson.annotation.date;
import java.io.IOException;
import java.text.ParseException;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java
similarity index 95%
rename from jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateSerializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java
index d840e1940f..1e869d876a 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/date/CustomDateSerializer.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.date;
+package com.baeldung.jackson.annotation.date;
import java.io.IOException;
import java.text.SimpleDateFormat;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithFormat.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java
similarity index 92%
rename from jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithFormat.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java
index 607e694cef..423b927976 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithFormat.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.date;
+package com.baeldung.jackson.annotation.date;
import java.util.Date;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java
similarity index 93%
rename from jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithSerializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java
index c359b5c846..292cb9129d 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/date/EventWithSerializer.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.date;
+package com.baeldung.jackson.annotation.date;
import java.util.Date;
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java
new file mode 100644
index 0000000000..fe86d48f6a
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java
@@ -0,0 +1,41 @@
+package com.baeldung.jackson.annotation.deserialization;
+
+import java.io.IOException;
+
+import com.baeldung.jackson.annotation.dtos.ItemWithSerializer;
+import com.baeldung.jackson.annotation.dtos.User;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.node.IntNode;
+
+public class ItemDeserializerOnClass extends StdDeserializer {
+
+ private static final long serialVersionUID = 5579141241817332594L;
+
+ public ItemDeserializerOnClass() {
+ this(null);
+ }
+
+ public ItemDeserializerOnClass(final Class> vc) {
+ super(vc);
+ }
+
+ /**
+ * {"id":1,"itemNr":"theItem","owner":2}
+ */
+ @Override
+ public ItemWithSerializer deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ final JsonNode node = jp.getCodec()
+ .readTree(jp);
+ final int id = (Integer) ((IntNode) node.get("id")).numberValue();
+ final String itemName = node.get("itemName")
+ .asText();
+ final int userId = (Integer) ((IntNode) node.get("owner")).numberValue();
+
+ return new ItemWithSerializer(id, itemName, new User(userId, null));
+ }
+
+}
\ No newline at end of file
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java
new file mode 100644
index 0000000000..009789bbf6
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java
@@ -0,0 +1,32 @@
+package com.baeldung.jackson.annotation.dtos;
+
+public class Item {
+ public int id;
+ public String itemName;
+ public User owner;
+
+ public Item() {
+ super();
+ }
+
+ public Item(final int id, final String itemName, final User owner) {
+ this.id = id;
+ this.itemName = itemName;
+ this.owner = owner;
+ }
+
+ // API
+
+ public int getId() {
+ return id;
+ }
+
+ public String getItemName() {
+ return itemName;
+ }
+
+ public User getOwner() {
+ return owner;
+ }
+
+}
\ No newline at end of file
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java
new file mode 100644
index 0000000000..a4cd7d78ad
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java
@@ -0,0 +1,36 @@
+package com.baeldung.jackson.annotation.dtos;
+
+import com.baeldung.jackson.annotation.deserialization.ItemDeserializerOnClass;
+import com.baeldung.jackson.annotation.serialization.ItemSerializerOnClass;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+@JsonSerialize(using = ItemSerializerOnClass.class)
+@JsonDeserialize(using = ItemDeserializerOnClass.class)
+public class ItemWithSerializer {
+ public final int id;
+ public final String itemName;
+ public final User owner;
+
+ public ItemWithSerializer(final int id, final String itemName, final User owner) {
+ this.id = id;
+ this.itemName = itemName;
+ this.owner = owner;
+ }
+
+ // API
+
+ public int getId() {
+ return id;
+ }
+
+ public String getItemName() {
+ return itemName;
+ }
+
+ public User getOwner() {
+ return owner;
+ }
+
+}
\ No newline at end of file
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/User.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/User.java
new file mode 100644
index 0000000000..9a4ec08ec3
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/User.java
@@ -0,0 +1,26 @@
+package com.baeldung.jackson.annotation.dtos;
+
+public class User {
+ public int id;
+ public String name;
+
+ public User() {
+ super();
+ }
+
+ public User(final int id, final String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ // API
+
+ public int getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
\ No newline at end of file
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java
new file mode 100644
index 0000000000..574908523a
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java
@@ -0,0 +1,29 @@
+package com.baeldung.jackson.annotation.dtos.withEnum;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+public enum DistanceEnumWithValue {
+ KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001);
+
+ private String unit;
+ private final double meters;
+
+ private DistanceEnumWithValue(String unit, double meters) {
+ this.unit = unit;
+ this.meters = meters;
+ }
+
+ @JsonValue
+ public double getMeters() {
+ return meters;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+
+}
\ No newline at end of file
diff --git a/jackson/src/test/java/com/baeldung/jackson/exception/UserWithRoot.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java
similarity index 86%
rename from jackson/src/test/java/com/baeldung/jackson/exception/UserWithRoot.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java
index d879c16e6a..629f444356 100644
--- a/jackson/src/test/java/com/baeldung/jackson/exception/UserWithRoot.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.exception;
+package com.baeldung.jackson.annotation.exception;
import com.fasterxml.jackson.annotation.JsonRootName;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/exception/UserWithRootNamespace.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java
similarity index 87%
rename from jackson-simple/src/test/java/com/baeldung/jackson/exception/UserWithRootNamespace.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java
index bf8c85efba..8f863168af 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/exception/UserWithRootNamespace.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.exception;
+package com.baeldung.jackson.annotation.exception;
import com.fasterxml.jackson.annotation.JsonRootName;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Item.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java
similarity index 92%
rename from jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Item.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java
index 26d20d4847..3a2681e0f0 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Item.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.jsonview;
+package com.baeldung.jackson.annotation.jsonview;
import com.fasterxml.jackson.annotation.JsonView;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Views.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java
similarity index 70%
rename from jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Views.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java
index 65950b7f9f..567592608a 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/jsonview/Views.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.jsonview;
+package com.baeldung.jackson.annotation.jsonview;
public class Views {
public static class Public {
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java
new file mode 100644
index 0000000000..cc17228de2
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java
@@ -0,0 +1,32 @@
+package com.baeldung.jackson.annotation.serialization;
+
+import java.io.IOException;
+
+import com.baeldung.jackson.annotation.dtos.Item;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+
+public class ItemSerializer extends StdSerializer- {
+
+ private static final long serialVersionUID = 6739170890621978901L;
+
+ public ItemSerializer() {
+ this(null);
+ }
+
+ public ItemSerializer(final Class
- t) {
+ super(t);
+ }
+
+ @Override
+ public final void serialize(final Item value, final JsonGenerator jgen, final SerializerProvider provider) throws IOException, JsonProcessingException {
+ jgen.writeStartObject();
+ jgen.writeNumberField("id", value.id);
+ jgen.writeStringField("itemName", value.itemName);
+ jgen.writeNumberField("owner", value.owner.id);
+ jgen.writeEndObject();
+ }
+
+}
\ No newline at end of file
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java
new file mode 100644
index 0000000000..bad44c01e7
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java
@@ -0,0 +1,32 @@
+package com.baeldung.jackson.annotation.serialization;
+
+import java.io.IOException;
+
+import com.baeldung.jackson.annotation.dtos.ItemWithSerializer;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+
+public class ItemSerializerOnClass extends StdSerializer {
+
+ private static final long serialVersionUID = -1760959597313610409L;
+
+ public ItemSerializerOnClass() {
+ this(null);
+ }
+
+ public ItemSerializerOnClass(final Class t) {
+ super(t);
+ }
+
+ @Override
+ public final void serialize(final ItemWithSerializer value, final JsonGenerator jgen, final SerializerProvider provider) throws IOException, JsonProcessingException {
+ jgen.writeStartObject();
+ jgen.writeNumberField("id", value.id);
+ jgen.writeStringField("itemName", value.itemName);
+ jgen.writeNumberField("owner", value.owner.id);
+ jgen.writeEndObject();
+ }
+
+}
\ No newline at end of file
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/CustomListDeserializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/CustomListDeserializer.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/CustomListDeserializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/CustomListDeserializer.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/CustomListSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/CustomListSerializer.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/CustomListSerializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/CustomListSerializer.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/Item.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/Item.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/Item.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/Item.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithIdentity.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithIgnore.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithRef.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithRef.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/ItemWithRef.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithRef.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithSerializer.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithSerializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithSerializer.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithView.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithView.java
similarity index 90%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithView.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithView.java
index ffa19fbad2..5cf9cd9981 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/ItemWithView.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/ItemWithView.java
@@ -1,6 +1,6 @@
package com.baeldung.jackson.bidirection;
-import com.baeldung.jackson.jsonview.Views;
+import com.baeldung.jackson.bidirection.jsonview.Views;
import com.fasterxml.jackson.annotation.JsonView;
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/User.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/User.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/User.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/User.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithIdentity.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithIdentity.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithIdentity.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithIdentity.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithIgnore.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithIgnore.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithIgnore.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithIgnore.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithRef.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithRef.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/bidirection/UserWithRef.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithRef.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithSerializer.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithSerializer.java
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithSerializer.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithSerializer.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithView.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithView.java
similarity index 92%
rename from jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithView.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithView.java
index d92d67b3a1..ad73eb8f92 100644
--- a/jackson/src/test/java/com/baeldung/jackson/bidirection/UserWithView.java
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/UserWithView.java
@@ -3,7 +3,7 @@ package com.baeldung.jackson.bidirection;
import java.util.ArrayList;
import java.util.List;
-import com.baeldung.jackson.jsonview.Views;
+import com.baeldung.jackson.bidirection.jsonview.Views;
import com.fasterxml.jackson.annotation.JsonView;
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/jsonview/Views.java b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/jsonview/Views.java
new file mode 100644
index 0000000000..0a13d55a5b
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/bidirection/jsonview/Views.java
@@ -0,0 +1,9 @@
+package com.baeldung.jackson.bidirection.jsonview;
+
+public class Views {
+ public static class Public {
+ }
+
+ public static class Internal extends Public {
+ }
+}
diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/domain/Person.java b/jackson-annotations/src/main/java/com/baeldung/jackson/domain/Person.java
new file mode 100644
index 0000000000..f11ba41113
--- /dev/null
+++ b/jackson-annotations/src/main/java/com/baeldung/jackson/domain/Person.java
@@ -0,0 +1,30 @@
+package com.baeldung.jackson.domain;
+
+public class Person {
+
+ private String firstName;
+ private String lastName;
+
+ public Person(String firstName, String lastName) {
+ super();
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
+
diff --git a/jackson/src/main/java/com/baeldung/jackson/format/User.java b/jackson-annotations/src/main/java/com/baeldung/jackson/format/User.java
old mode 100755
new mode 100644
similarity index 100%
rename from jackson/src/main/java/com/baeldung/jackson/format/User.java
rename to jackson-annotations/src/main/java/com/baeldung/jackson/format/User.java
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/ExtraAnnotationUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AdvancedAnnotationsUnitTest.java
similarity index 92%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/ExtraAnnotationUnitTest.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AdvancedAnnotationsUnitTest.java
index 647c451659..c0eb917292 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/ExtraAnnotationUnitTest.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AdvancedAnnotationsUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -12,10 +12,10 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import com.baeldung.jackson.annotation.extra.AppendBeans.BeanWithAppend;
-import com.baeldung.jackson.annotation.extra.AppendBeans.BeanWithoutAppend;
-import com.baeldung.jackson.annotation.extra.IdentityReferenceBeans.BeanWithIdentityReference;
-import com.baeldung.jackson.annotation.extra.IdentityReferenceBeans.BeanWithoutIdentityReference;
+import com.baeldung.jackson.advancedannotations.AppendBeans.BeanWithAppend;
+import com.baeldung.jackson.advancedannotations.AppendBeans.BeanWithoutAppend;
+import com.baeldung.jackson.advancedannotations.IdentityReferenceBeans.BeanWithIdentityReference;
+import com.baeldung.jackson.advancedannotations.IdentityReferenceBeans.BeanWithoutIdentityReference;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping;
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
-public class ExtraAnnotationUnitTest {
+public class AdvancedAnnotationsUnitTest {
@Test
public void whenNotUsingJsonIdentityReferenceAnnotation_thenCorrect() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/AppendBeans.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AppendBeans.java
similarity index 95%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/AppendBeans.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AppendBeans.java
index 7b75c205c9..ab045dd0c6 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/AppendBeans.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/AppendBeans.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.databind.annotation.JsonAppend;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/IdentityReferenceBeans.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/IdentityReferenceBeans.java
similarity index 96%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/IdentityReferenceBeans.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/IdentityReferenceBeans.java
index 0a8736d9a5..6e723c317a 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/IdentityReferenceBeans.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/IdentityReferenceBeans.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/NamingBean.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/NamingBean.java
similarity index 92%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/NamingBean.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/NamingBean.java
index efd26ab9ae..323df49c14 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/NamingBean.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/NamingBean.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/POJOBuilderBean.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/POJOBuilderBean.java
similarity index 96%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/POJOBuilderBean.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/POJOBuilderBean.java
index e0a89c6903..97b747fe40 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/POJOBuilderBean.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/POJOBuilderBean.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/PropertyDescriptionBean.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/PropertyDescriptionBean.java
similarity index 90%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/PropertyDescriptionBean.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/PropertyDescriptionBean.java
index 1563cddb83..dcc0c67054 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/PropertyDescriptionBean.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/PropertyDescriptionBean.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdBean.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdBean.java
similarity index 90%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdBean.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdBean.java
index 32a6d5a1d5..1b25529743 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdBean.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdBean.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import com.fasterxml.jackson.annotation.JsonTypeId;
diff --git a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdResolverStructure.java b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdResolverStructure.java
similarity index 98%
rename from jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdResolverStructure.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdResolverStructure.java
index 9056023c69..f9ddd8eea9 100644
--- a/jackson/src/test/java/com/baeldung/jackson/annotation/extra/TypeIdResolverStructure.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/advancedannotations/TypeIdResolverStructure.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.annotation.extra;
+package com.baeldung.jackson.advancedannotations;
import java.util.List;
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonAnnotationUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java
similarity index 90%
rename from jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonAnnotationUnitTest.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java
index ee11f8f20e..462b65787a 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonAnnotationUnitTest.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.test;
+package com.baeldung.jackson.annotation;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
@@ -14,32 +14,18 @@ import java.util.TimeZone;
import org.junit.Test;
-import com.baeldung.jackson.annotation.AliasBean;
-import com.baeldung.jackson.annotation.BeanWithCreator;
-import com.baeldung.jackson.annotation.BeanWithCustomAnnotation;
-import com.baeldung.jackson.annotation.BeanWithFilter;
-import com.baeldung.jackson.annotation.BeanWithGetter;
-import com.baeldung.jackson.annotation.BeanWithIgnore;
-import com.baeldung.jackson.annotation.BeanWithInject;
-import com.baeldung.jackson.annotation.ExtendableBean;
-import com.baeldung.jackson.annotation.MyBean;
-import com.baeldung.jackson.annotation.PrivateBean;
-import com.baeldung.jackson.annotation.RawBean;
-import com.baeldung.jackson.annotation.UnwrappedUser;
-import com.baeldung.jackson.annotation.UserWithIgnoreType;
-import com.baeldung.jackson.annotation.Zoo;
-import com.baeldung.jackson.bidirection.ItemWithIdentity;
-import com.baeldung.jackson.bidirection.ItemWithRef;
-import com.baeldung.jackson.bidirection.UserWithIdentity;
-import com.baeldung.jackson.bidirection.UserWithRef;
-import com.baeldung.jackson.date.EventWithFormat;
-import com.baeldung.jackson.date.EventWithSerializer;
-import com.baeldung.jackson.dtos.MyMixInForIgnoreType;
-import com.baeldung.jackson.dtos.withEnum.DistanceEnumWithValue;
-import com.baeldung.jackson.exception.UserWithRoot;
-import com.baeldung.jackson.exception.UserWithRootNamespace;
-import com.baeldung.jackson.jsonview.Item;
-import com.baeldung.jackson.jsonview.Views;
+import com.baeldung.jackson.annotation.bidirection.ItemWithIdentity;
+import com.baeldung.jackson.annotation.bidirection.ItemWithRef;
+import com.baeldung.jackson.annotation.bidirection.UserWithIdentity;
+import com.baeldung.jackson.annotation.bidirection.UserWithRef;
+import com.baeldung.jackson.annotation.date.EventWithFormat;
+import com.baeldung.jackson.annotation.date.EventWithSerializer;
+import com.baeldung.jackson.ignore.dtos.MyMixInForIgnoreType;
+import com.baeldung.jackson.annotation.dtos.withEnum.DistanceEnumWithValue;
+import com.baeldung.jackson.annotation.exception.UserWithRoot;
+import com.baeldung.jackson.annotation.exception.UserWithRootNamespace;
+import com.baeldung.jackson.annotation.jsonview.Item;
+import com.baeldung.jackson.annotation.jsonview.Views;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.MapperFeature;
@@ -352,13 +338,13 @@ public class JacksonAnnotationUnitTest {
// @Ignore("Jackson 2.7.1-1 seems to have changed the API regarding mixins")
@Test
public void whenSerializingUsingMixInAnnotation_thenCorrect() throws JsonProcessingException {
- final com.baeldung.jackson.dtos.Item item = new com.baeldung.jackson.dtos.Item(1, "book", null);
+ final com.baeldung.jackson.annotation.dtos.Item item = new com.baeldung.jackson.annotation.dtos.Item(1, "book", null);
String result = new ObjectMapper().writeValueAsString(item);
assertThat(result, containsString("owner"));
final ObjectMapper mapper = new ObjectMapper();
- mapper.addMixIn(com.baeldung.jackson.dtos.User.class, MyMixInForIgnoreType.class);
+ mapper.addMixIn(com.baeldung.jackson.annotation.dtos.User.class, MyMixInForIgnoreType.class);
result = mapper.writeValueAsString(item);
assertThat(result, not(containsString("owner")));
diff --git a/jackson/src/test/java/com/baeldung/jackson/test/JacksonBidirectionRelationUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/bidirection/JacksonBidirectionRelationUnitTest.java
similarity index 87%
rename from jackson/src/test/java/com/baeldung/jackson/test/JacksonBidirectionRelationUnitTest.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/bidirection/JacksonBidirectionRelationUnitTest.java
index e55ca55ac9..d0c5209891 100644
--- a/jackson/src/test/java/com/baeldung/jackson/test/JacksonBidirectionRelationUnitTest.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/bidirection/JacksonBidirectionRelationUnitTest.java
@@ -1,4 +1,4 @@
-package com.baeldung.jackson.test;
+package com.baeldung.jackson.bidirection;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
@@ -9,19 +9,7 @@ import java.io.IOException;
import org.junit.Test;
-import com.baeldung.jackson.bidirection.Item;
-import com.baeldung.jackson.bidirection.ItemWithIdentity;
-import com.baeldung.jackson.bidirection.ItemWithIgnore;
-import com.baeldung.jackson.bidirection.ItemWithRef;
-import com.baeldung.jackson.bidirection.ItemWithSerializer;
-import com.baeldung.jackson.bidirection.ItemWithView;
-import com.baeldung.jackson.bidirection.User;
-import com.baeldung.jackson.bidirection.UserWithIdentity;
-import com.baeldung.jackson.bidirection.UserWithIgnore;
-import com.baeldung.jackson.bidirection.UserWithRef;
-import com.baeldung.jackson.bidirection.UserWithSerializer;
-import com.baeldung.jackson.bidirection.UserWithView;
-import com.baeldung.jackson.jsonview.Views;
+import com.baeldung.jackson.bidirection.jsonview.Views;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/jackson/src/test/java/com/baeldung/jackson/format/JsonFormatUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/format/JsonFormatUnitTest.java
old mode 100755
new mode 100644
similarity index 100%
rename from jackson/src/test/java/com/baeldung/jackson/format/JsonFormatUnitTest.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/format/JsonFormatUnitTest.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java
similarity index 96%
rename from jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java
index da8b464d03..ab51fc11e7 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java
@@ -10,15 +10,15 @@ import java.util.Map;
import org.junit.Test;
-import com.baeldung.jackson.dtos.MyDto;
-import com.baeldung.jackson.dtos.MyDtoIncludeNonDefault;
-import com.baeldung.jackson.dtos.MyDtoWithFilter;
-import com.baeldung.jackson.dtos.MyDtoWithSpecialField;
-import com.baeldung.jackson.dtos.MyMixInForIgnoreType;
+import com.baeldung.jackson.ignore.dtos.MyDto;
+import com.baeldung.jackson.ignore.dtos.MyDtoIncludeNonDefault;
+import com.baeldung.jackson.ignore.dtos.MyDtoWithFilter;
+import com.baeldung.jackson.ignore.dtos.MyDtoWithSpecialField;
+import com.baeldung.jackson.ignore.dtos.MyMixInForIgnoreType;
import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreField;
import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreFieldByName;
import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreNull;
-import com.baeldung.jackson.serialization.MyDtoNullKeySerializer;
+import com.baeldung.jackson.ignore.dtos.MyDtoNullKeySerializer;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java
new file mode 100644
index 0000000000..3357c041c0
--- /dev/null
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java
@@ -0,0 +1,54 @@
+package com.baeldung.jackson.ignore.dtos;
+
+public class MyDto {
+
+ private String stringValue;
+ private int intValue;
+ private boolean booleanValue;
+
+ public MyDto() {
+ super();
+ }
+
+ public MyDto(final String stringValue, final int intValue, final boolean booleanValue) {
+ super();
+
+ this.stringValue = stringValue;
+ this.intValue = intValue;
+ this.booleanValue = booleanValue;
+ }
+
+ // API
+
+ public String getStringValue() {
+ return stringValue;
+ }
+
+ public void setStringValue(final String stringValue) {
+ this.stringValue = stringValue;
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public void setIntValue(final int intValue) {
+ this.intValue = intValue;
+ }
+
+ public boolean isBooleanValue() {
+ return booleanValue;
+ }
+
+ public void setBooleanValue(final boolean booleanValue) {
+ this.booleanValue = booleanValue;
+ }
+
+ //
+
+ @Override
+ public String toString() {
+ return "MyDto [stringValue=" + stringValue + ", intValue=" + intValue + ", booleanValue=" + booleanValue + "]";
+ }
+
+}
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java
similarity index 100%
rename from jackson-simple/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java
diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java
new file mode 100644
index 0000000000..cf5d1682db
--- /dev/null
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java
@@ -0,0 +1,43 @@
+package com.baeldung.jackson.ignore.dtos;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public class MyDtoIncludeNonDefault {
+
+ private String stringValue;
+ private int intValue;
+ private boolean booleanValue;
+
+ public MyDtoIncludeNonDefault() {
+ super();
+ }
+
+ // API
+
+ public String getStringValue() {
+ return stringValue;
+ }
+
+ public void setStringValue(final String stringValue) {
+ this.stringValue = stringValue;
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public void setIntValue(final int intValue) {
+ this.intValue = intValue;
+ }
+
+ public boolean isBooleanValue() {
+ return booleanValue;
+ }
+
+ public void setBooleanValue(final boolean booleanValue) {
+ this.booleanValue = booleanValue;
+ }
+
+}
diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/MyDtoNullKeySerializer.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoNullKeySerializer.java
similarity index 91%
rename from jackson-simple/src/test/java/com/baeldung/jackson/serialization/MyDtoNullKeySerializer.java
rename to jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoNullKeySerializer.java
index d0b2d7f5e9..dcd4070dba 100644
--- a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/MyDtoNullKeySerializer.java
+++ b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoNullKeySerializer.java
@@ -1,27 +1,27 @@
-package com.baeldung.jackson.serialization;
-
-import java.io.IOException;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-
-public class MyDtoNullKeySerializer extends StdSerializer