jackson-module-scala icon indicating copy to clipboard operation
jackson-module-scala copied to clipboard

Support Gradle 6 version alignment with Jackson Scala module (`jackson-module-scala`)

Open cowtowncoder opened this issue 4 years ago • 4 comments

(as background, see https://github.com/FasterXML/jackson-databind/issues/2726)

So, Jackson 2.12 is adding support for Gradle version alignment, using mechanism supported by Gradle 6. @jjohannes contributed this for other modules and hopefully can help, or at least indicate whether this is feasible with sbt build. There may also be changes needed to jackson-integration-tests test repo, depending on whether metadata may be added.

cowtowncoder avatar Nov 15 '20 21:11 cowtowncoder

@cowtowncoder the scala module appears in the main BOM file already. Example: https://oss.sonatype.org/content/repositories/snapshots/com/fasterxml/jackson/jackson-bom/2.12.0-rc2-SNAPSHOT/jackson-bom-2.12.0-rc2-20201103.195011-11.pom

Is the aim to have scala module publish a .module file https://oss.sonatype.org/content/repositories/snapshots/com/fasterxml/jackson/core/jackson-databind/2.12.0-rc2-SNAPSHOT/jackson-databind-2.12.0-rc2-20201115.032546-135.module ?

I haven't found any sbt support or sbt plugin support fo such a file. All in all, I suspect it is best to see if there is community demand for this before expending effort on it.

pjfanning avatar Nov 16 '20 12:11 pjfanning

This is a new feature for Jackson 2.12, so community demand is bit of a chicken/egg problem. But I filed issue more as likely placeholder, to surface it and maybe get contributions, help. So expectation was not that this is a must-have at this point: if there is no sbt support that would probably be tricky to pull off.

cowtowncoder avatar Nov 16 '20 19:11 cowtowncoder

In practice, this is not a problem for the alignment use case, because the Scala module has a dependency to Jackson Core with the same version. The transitive dependencies of Jackson Core (which has the module file) will then take care of the alignment to that version (see https://github.com/FasterXML/jackson-integration-tests/issues/6 for details).

Supporting Gradle Metadata (.module) with sbt and in Gradle's own Scala support is however very interesting in general. I believe we could get to a setup where, on the long run, encoding the Scala version in the name of the module would not be necessary anymore. As with Gradle Metadata you could publish all Jars as different variants under one GAV coordinate.

At Gradle, we just did not get around to push this topic yet. But if someone from the Scala community is happening to read this and interested in this, please feel free to reach out to me.

jjohannes avatar Nov 25 '20 08:11 jjohannes

Sounds good; this issue can remain open so that others might be able to find it.

cowtowncoder avatar Nov 25 '20 18:11 cowtowncoder