[英]Get Sonar host url in Plugin Code (for REST calls)
I'm working on a Sonar Plugin where I need to make some REST calls inside the Sensor/Decorator. 我正在研究Sonar插件,需要在Sensor / Decorator内进行一些REST调用。 How do I get the URL of the Sonar Host? 如何获取声纳主机的URL?
Thanks! 谢谢!
If you are refering to the Server base URL (Settings - General) I did it like this: 如果您指的是服务器基本URL(设置-常规),我这样做是这样的:
settings.getString("sonar.core.serverBaseURL")
sonar.core.serverBaseURL is the key for the setting. sonar.core.serverBaseURL是该设置的键。
This returns http://localhost:9000 on my local test-machine. 这将在我的本地测试机上返回http:// localhost:9000 。 ;) ;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.