logstash-plugins / logstash-input-tcp

Apache License 2.0
35 stars 75 forks source link

Build: skip shadowing jar dependencies #187

Closed kares closed 2 years ago

kares commented 2 years ago

There's 2 changes here (they can be split into 2 PRs if needed):

1. avoid shadow-ing dependencies

the shadow repackages dependencies into the logstash-input-tcp-X.Y.Z.jar, meaning e.g. classes from netty-all-4.1.65.Final.jar will all end up as part of the plugin jar on $CLASSPATH. this is bad and if we would to have any kind of feature detection based on a class present would lead to issues:

here's what happens when 2 plugins load the same dependency (one shadowed):

after shadowing removed here's what happens:

2. make log4j-api a 'provided' dependency

the log4j-api should be considered a transitive dependency of logstash-core. we need the log4j-api jar for compiling but should not package the .jar into the plugin - LS lacks abstraction of custom logger impl for Java plugins thus the log4j-api should simply be considered a provided dependency.