Leiningen Java agents does not work in uberjar
In my leiningen project, I have the following configurations:
:java-agents [[com.newrelic.agent.java/newrelic-agent "3.19.2"]]
When I run my application in lein repl, the agent is running, but when I create the uberjar and run it:
java -jar target/proclodo-spa-server-rendering.jar
Agent not started I can include new relic - agent in my uberjar Jar and pass the - javaagent parameter, but I try to avoid having large binary blobs in my repository without automatic upgrade (why does new relic even suggest this?) I tried to add:
:bootclasspath true
Because of this comment:
;; Java agents can instrument and intercept certain VM features. Include ;; :bootclasspath true to place the agent jar on the bootstrap classpath.
But it makes no difference How do I put the proxy jar in classpath so that I can verify that it works?
I'm using jetty, which is said to interfere with bootclasspath, but I'm not sure how it should interfere Everything seems to be working well, it's just the agent didn't start
Solution
If you run Java yourself, you must pass the VM options yourself, such as the debugging agent to use Lein cannot package it into jars: there is no mechanism to do this