- Notifications
You must be signed in to change notification settings - Fork 3.5k
Update the java plugin loading logic to process the manifest file. #13979
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
base: main
Are you sure you want to change the base?
Conversation
Jenkins test this please |
c14979e
to f6c8c36
Compare dd3c19e
to 5eb7baf
Compare The CI fails is on integration test:
with the error:
|
3a4fbf2
to cccdb95
Compare …to plugin jar entry point
…oad multi jars plugin gem
…to plugin jar entry point
…lled or remotely from rubygems
… test multi-jar plugin
b34d353
to 267d203
Compare This pull request does not have a backport label. Could you fix it @andsel? 🙏
|
|
This pull request is now in conflicts. Could you fix it @andsel? 🙏
|
Release notes
Enable the usage of not shadowed Java plugins
What does this PR do?
Update the Java plugins loading from gems to use multijar plugins.
Before this PR the example Java plugins come with a single shadowed jar with all the dependent jars squashed into.
The shadowed jar also bundle Logstash classes and logging libraries, driving to an increase of file size, but also polluting the classpath.
With PR logstash-plugins/logstash-input-java_input_example#15 it fixes the problem on plugin side.
Logstash needs to recognize and properly load multijar plugins.
With this PR if the Ruby gem contains a single jar, then it behaves like before and uses that jar as the container of the plugin's root class. If the gem file contains multiple jar that is return the jar file that contains the
Logstash-plugin
property is itsMANIFEST.mf
.Why is it important/What is the impact to the user?
Let the developer to implement pure Java Logstash plugins that could be used into the project.
The native Java plugins generally bundles all the the transitive dependencies inside an uber jar. However, due to the Gradle's shadow plugin, this generates a problem because the uber jar contains also Logstash's core classes, and this could generate a problem with class loading. On the other side, mixed Ruby/Java plugins can ship multiple jars used by the plugins itself.
This PR aims to bundle multiple jars inside a native Java plugins, permitting the correct loading of the plugin's main class through the usage of manifest file.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Test as described in PR logstash-plugins/logstash-input-java_input_example#15
Related issues
Use cases
As a developer I want to bundle only the required libraries used by a native plugin, bundling them and permitting the correct loading of the plugin's main class.
Screenshots
Logs
Error happening when loading a Java plugin with multuple jars contained: