Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Jackson 4.0.0 branch built with Java 11 and supporting the Java Module System #10

Open
guaporocco opened this issue Feb 23, 2019 · 4 comments

Comments

@guaporocco
Copy link

Jackson is a great library, but its frustrating that we can't use it with the Java Module System. Yes, jackson does have automatic module names, but you cannot build a minimal application image (jlink) or installer (jpackage) without explicit module-infos.

I tried forking jackson databind and its dependent projects, generating module-infos with jdeps, and then using javac --patch-module to repackage, but jlink still fails because it sees the Automatic Module Name field.

Although maintaining another branch may be require extra work, I think its worth considering to get the performance and size benefits of Java 11's defining feature. And since Java 11 is LTS, I expect the 4.0.0 branch would be created eventually.

@guaporocco
Copy link
Author

I should add that modules could also help structure Jacksons code. jackson-databind depends on java.desktop, java.sql, and java.xml, for example, and since most developers don't make use of when using Jackson, databind could be split into modules databind.sql, databind.xml, etc.

@cowtowncoder
Copy link
Member

Please do not file issues suggesting wide-ranging fundamental changes; instead bring them up on mailing lists. That's a good place to discuss these.

There are plans to use Moditect to make 2.10 and onwards (more) forwards-compatible, being built using JDK 8, but having basic module definitions, but still targeting Java 7 bytecode. Latter may become non-goal.

For 3.x this is the minimum baseline as well: baseline was moved to Java 8.
At this point I would like to make things work with module system, but have no personal interest in JDKs beyond 8, feature-wise yet. This may change depending on how long it will still take to get to 3.0 release, as well as adoption. At work, for example, I would not be able to use anythjing that relies on Java 11. Adoption has been slow, due to the way Oracle decide to force their ill-advised module upgrade, which essentially requires all-or-nothing approach.
Things will move along, of course, but I don't want to be on the bleeding edge working for things I have serious reservations about.

@guaporocco
Copy link
Author

Using Moditect to generate module definitions would be very nice, hopefully databind is published in multiple modules (so that one does not have to rely on all each java.[xml, desktop, sql]).

I agree that the module system is somewhat of a pain and will have slower adoption. It's quite useful to build super-small docker images though (has saved us some money at least). And I'd expect that when Valhalla releases with value types in a year or two, there will be a big migration like with lambdas.

@cowtowncoder
Copy link
Member

The issue of what to do with non-core JDK datatypes is interesting. Perhaps it'd be best to cleave them out and add a separate "jackson-datatype-jdk[11]"...

As to Moditect, I will either need to find time to dig into it, or get help -- some contributors have helped with prototype, but I don't think we have yet functional solution that I find good enough (there have been discussions on baseline, requirements and so on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants