Closed swamyrajamohan closed 4 months ago
Tried it with the newer version 0.5.1 as well and still the same issue
👋 i wouldn't expect it to work with the artifacts built by the shadow task - feel free to make a PR! If you want to make a specific proposal around any api changes, let me know. I'm unfamiliar with the purpose of the shadowDistTar
and shadowDistZip
tasks? My understanding was the purpose of the shadow plugin was to create an uber-jar that could be run in a standalone fashion. What is the purpose of putting an uber-jar inside of a tar/zip that uses a start script and abstracts away adding dependencies to the classpath? Adding support for a new plugin integration creates a maintenance burden, so I would need to see a compelling reason for folks to actually use a javaagent with these distributions.
Note that javaagents themselves can't be shaded into the shadow jar, as they need to be specified with the -javaagent
flag or registered programatically. Perhaps you're looking for something like https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/static-instrumenter
I think this is the same as #94, where I've included a potential workaround @swamyrajamohan
closed as duplicate of #94
When used with the gradle-shadow plugin and creating the shadowDistTar or shadowDistZip instead of the regular distZip and distTar provided by the application plugin the resultant distributions don't contain the agent-libs directory in the distribution (zip/tar).
tar produced by the distTar after applying the javaagent-gradle-plugin agent-libs # containing the javaagent lib bin # containing the startup scripts lib # containing the dependent libraries and application jar
tar produced by the distTar after applying the javaagent-gradle-plugin
Misses the agent-libs folder containing javaagent lib
bin # containing the startup scripts lib # containing the dependent libraries and application jar