Error when upgrading jackson-databind, jackson-core to version 2.15.0-rc1 #160
-
Hello All, I am working on a project with JDK 8 at the moment and is trying to upgrade my current com.fasterxml.jackson.core jackson-databind to 2.15.0-rc1. The current version is 2.14.0. But when I do so I was given the this error From my reading on the wiki page, the build JDK is require to be JDK 11 but platform should be the same for 2.14.0, then how come it unable to make the build? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Are you sure that this is not an issue in your build config? Could you have set up maven-enforcer plugin to ban jars that have rc in their names? |
Beta Was this translation helpful? Give feedback.
-
Hello @pjfanning, Yes I have double check config of my enforcer. I did not to excludes or ban any jars. |
Beta Was this translation helpful? Give feedback.
-
Jackson 2.15 should still only require Java 8 for most things, including But looking at error message, it looks like some tool is incorrectly trying to load JDK11-only code; 2.15.0 is "multi-version jar". There have been reports of something similar wrt older versions of Gradle having issues with this: |
Beta Was this translation helpful? Give feedback.
-
Hello @cowtowncoder, so I just check the version for my Enforcer, it is 3.0.0-M2. Do you have any suggestion that I should make an update for that also? |
Beta Was this translation helpful? Give feedback.
-
Hi so I guess exclude the jackson-core will do the trick, need to add exclude tag within enforceBytecodeVersion. Thanks @cowtowncoder for the support. |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell, latest versions of <?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>project1</artifactId>
<version>0.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.0-rc1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<phase>validate</phase>
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>8</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> $ gm validate
Using maven at '/Users/aalmiray/.sdkman/candidates/maven/current/bin/mvn' to run buildFile '/tmp/foo/pom.xml':
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.acme:project1 >--------------------------
[INFO] Building project1 0.0.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- enforcer:3.3.0:enforce (default) @ project1 ---
[INFO] Adding ignore: module-info
[INFO] Rule 0: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion passed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.323 s
[INFO] Finished at: 2023-04-12T18:34:37+02:00
[INFO] ------------------------------------------------------------------------ The
|
Beta Was this translation helpful? Give feedback.
Ok. Perhaps you need to exclude checking for
jackson-core
altogether then; or possibly specific classes.Optionally loaded classes are in package
com/fasterxml/jackson/core/io/doubleparser
and included in a way that JVM only loads them as overrides for specific JDK: they come from "FastDoubleParser" project.They should not cause issues when running on earlier JDK versions: that's the whole point of multi-release (MR) jars.