-
Notifications
You must be signed in to change notification settings - Fork 45
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
Package naming conventions #56
Comments
Thank you for the good word! 👍 I agree, unfortunately basic good practices are not followed when it comes to package names. In most cases it's due to the need to access package-private or protected classes, either for extensions (see *MixIn classes) or to introduce some performance improvements - Also, most classes are just dumped into the main package - this will change in 2.0 (end of next year at least) when I'll have a look at those packages and see what I can do. So far:
Is this issue blocking you completely atm? Is 1.4.4 unusable for you? |
I'm not blocked, that's a kind of general question. I'm doing modules since years, but my descendants in company could be not very happy after taking over such legacy. If I simply say "I will not use singleThread option", package 'com.fasterxml.jackson.core' is optional. I must omit this export and that's all (classes from this package will be never loaded, if this option is disabled). |
I was really hoping that this single design decision and classloading tricks will do the job for all cases.. Separate jar for jackson package-private classes would also contain actual Shading classes into |
For openjdk, I would say - yes. I'm only using this for container environment in kubernetes, so I could feel safe with that (no other implementation could be used accidentally).
It would handle, but if SingleThreadJsonFactory have their separate unique package name (that could be exported and consumed elsewhere). Yes, I'm also not a huge fan of shading classes. But decision about that should be consulted with question "Am I using internal APIs of third party library, that could be incompatibly changed between versions without notice?". Jackson library in the past had breaking changes between minor versions. |
Incompatibility is a risk with both reflection and package-private access approaches. I'll be very reluctant to add any reflection-based logic to the code base. If there's a need for a package-private access, I'd rather try to contribute to the source project to make this access easier.
Regardless of latency, it just feels wrong. If property is private, there's a reason for it. If it's package-private or protected - I can take the risk, especially if it's on the hot path. |
Thankfully, repackaging will be possible after I'll release it in 1.5 if possible. |
Good to hear. Please, send me a notification before release, I will try to check it for compatibility in modular system. |
…on-st:1.0 (#56) * In order to avoid package-related issues in OSGi environments, custom Jackson FasterXML JsonFactory was extracted to separate module
I'll extract Can you handle |
looks good for me. I really appreciate it. with org.apache.logging.log4j.core.jackson I have no problems at the moment, because it's not exported explicitly by pax-logging (no version conflict). |
I pushed latest log4j2-elasticsearch snapshots to Sonatype repos. |
Released in 1.5.0.
Enjoy! |
I'm using this brilliant library in modular project (OSGi).
Of course library is not OSGi complaint, but bunch of wrapping instructions and dirty solution for refreshing log4j2 PluginRegistry and log4j2 context is enough to make it working in apache karaf environment.
Newer versions are much more problematic with running in modular environment. It's because weird package naming inside jars.
In example, inside log4j2-elasticsearch-core we have
For now, biggest fault is com.fasterxml.jackson.core. That package is already present in jackson-core and that thing breaks package resolving.
There is a special reason for that kind of packaging? Most of projects in java world tries to keep things under single package root, equal to project groupId + moduleName. That really helps with modularity problems.
The text was updated successfully, but these errors were encountered: