春季靴子的新遗物 [英] New Relic for Spring Boot
问题描述
最近,我们将tomcat/spring应用程序转换为spring boot.除了新的文物,一切都运转良好.有没有一种方法可以让我轻松地使用Spring Boot项目配置新的文物.我不想对新的遗物代理jar路径的位置进行硬编码,然后使用该路径运行spring boot项目.
Recently, we convert a tomcat/spring app to spring boot. Everything is working fine apart from new relic. Is there a way I can easily config new relic with spring boot project. I don't want to hard code the location of new relic agent jar path, then run the spring boot project with the path.
Spring启动项目与maven结合
edit: Spring boot project is with maven
推荐答案
您可以包括NewRelic Maven依赖项,并使用maven-dependency-plugin
解压缩到您的target/classes
目录中,这使Maven可以将其包含在最终的Jar文件中.然后,您必须将Premain-Class
属性添加到清单文件中,然后才能将应用程序jar用作-javaagent
源.您可以在我的博客文章
You can include NewRelic Maven dependency and use maven-dependency-plugin
to unpack in into your target/classes
directory, which allows Maven to include it into final Jar file. Then you have to add Premain-Class
attribute into manifest file and you can use your application jar as -javaagent
source. You can find details on my blog post
这篇关于春季靴子的新遗物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!