@@ -137,6 +137,9 @@ public Builder withValidator(final Validator validator) {
137
137
* Creates a {@link Builder} to build {@link ConfigMapperFactory}.
138
138
*/
139
139
public static Builder builder () {
140
+ assertJacksonCoreVersion ();
141
+ assertJacksonDataBindVersion ();
142
+ assertJacksonDataTypeJdk8Version ();
140
143
return new Builder ();
141
144
}
142
145
@@ -320,6 +323,39 @@ private ObjectMapper mapperForOthers() {
320
323
return objectMapper ;
321
324
}
322
325
326
+ private static void assertJacksonCoreVersion () {
327
+ if (com .fasterxml .jackson .core .json .PackageVersion .VERSION .getMajorVersion () != 2 ) {
328
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2." );
329
+ }
330
+
331
+ final int minor = com .fasterxml .jackson .core .json .PackageVersion .VERSION .getMinorVersion ();
332
+ if (minor < 14 || (minor == 15 && com .fasterxml .jackson .core .json .PackageVersion .VERSION .getPatchLevel () <= 2 )) {
333
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2.15.3 or later." );
334
+ }
335
+ }
336
+
337
+ private static void assertJacksonDataBindVersion () {
338
+ if (com .fasterxml .jackson .databind .cfg .PackageVersion .VERSION .getMajorVersion () != 2 ) {
339
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2." );
340
+ }
341
+
342
+ final int minor = com .fasterxml .jackson .databind .cfg .PackageVersion .VERSION .getMinorVersion ();
343
+ if (minor < 14 || (minor == 15 && com .fasterxml .jackson .databind .cfg .PackageVersion .VERSION .getPatchLevel () <= 2 )) {
344
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2.15.3 or later." );
345
+ }
346
+ }
347
+
348
+ private static void assertJacksonDataTypeJdk8Version () {
349
+ if (com .fasterxml .jackson .datatype .jdk8 .PackageVersion .VERSION .getMajorVersion () != 2 ) {
350
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2." );
351
+ }
352
+
353
+ final int minor = com .fasterxml .jackson .datatype .jdk8 .PackageVersion .VERSION .getMinorVersion ();
354
+ if (minor < 14 || (minor == 15 && com .fasterxml .jackson .datatype .jdk8 .PackageVersion .VERSION .getPatchLevel () <= 2 )) {
355
+ throw new UnsupportedOperationException ("embulk-util-config is not used with Jackson 2.15.3 or later." );
356
+ }
357
+ }
358
+
323
359
private static final Logger logger = LoggerFactory .getLogger (ConfigMapperFactory .class );
324
360
325
361
private final List <Module > additionalModules ;
0 commit comments