This plugin can verify that the Jackson module versions of a project match. This check can run before running any (integration) tests or running your application in production, thereby avoiding runtime surprises. You can use it also as part of your build chain and make the build fail if non-matching versions are found.
According to the Jackson documentation extension modules are ONLY guaranteed to work with core components that have the same minor version, see https://github.com/FasterXML/jackson/wiki/Jackson-Releases#internal-api-versioning. Jackson-module-scala will always throw an exception if the major and minor versions do not match with jackson-databind's versions, see https://github.com/FasterXML/jackson-module-scala/blob/9735bcb5b0abd17453fa4aa9f1eef5889467fbf7/src/main/scala/com/fasterxml/jackson/module/scala/JacksonModule.scala#L61.
sbt-jackson-version-check is published for sbt 1.10.5 and above. To start using it add the following to your
plugins.sbt
:
addSbtPlugin("nl.gn0s1s" % "sbt-jackson-version-check" % "0.0.2")
Task | Description | Command |
---|---|---|
jacksonVersionCheck | Runs version check. | $ sbt jacksonVersionCheck |
You can configure the configuration in your build.sbt
file.
Setting | Description | Default Value |
---|---|---|
jacksonVersionCheckFailBuildOnNonMatchingVersions | Sets whether non-matching versions fail the build, if false non-matching versions show up as warnings in the log, if true they show up as errors. |
false |
jacksonVersionCheckStrict | Sets whether Jackson modules versions should match exactly, including the patch version. Otherwise only the major and minor versions should match. | false |
The code is available under the Apache 2.0 License.