Having the ByteBuddy enhancers integrated in hibernate-core has been handy, but there are several situations in which it would be better off as a separate artifact:
- When building GraalVM native images, this code should not be reachable as bytecode manilupation isn’t possible within the closed world set - this is currently a challenge to maintain and it would be simpler if it was contained in its separate compilation unit.
- When people use the build-time enhancer, they won’t actually need all this code and its dependencies to be included in the runtime that they ship to production. This is beneficial both in terms of size (not including our enhancer code nor ByteBuddy itself) and security, as a system with less dependencies is intrinsecarlly safer.
- It’s also good to limit dependencies, as it makes alignment challenges simpler; e.g. ByteBuddy is very popular and used in other libraries as well - it’s simpler to manage if we only need it within the scope of the enhancement tasks, which could be limited to build time.
|