I am using a javaagent for my spring boot app and currently I am running it via
java -javaagent:agent.jar -jar app.jar
My project is a gradle project and I want to embed the agent.jar inside the app.jar so that I can run it as
java -javaagent:app.jar -jar app.jar
It can be done via boot maven plugin as mentioned here - https://jeroendruwe.be/spring-boot-and-new-relic/ but there is no alternative for boot gradle plugin. The closest I find is this - https://jdpgrailsdev.github.io/blog/2014/04/08/spring_boot_gradle_newrelic.html, but it does not embed the jar as intended.
Is there anyway it can be done via gradle?