How to change Sensor name of self developed Sonar plugin in Jenkins

北城以北 提交于 2019-12-25 02:47:15

问题


after a while now I finished the development of my own SonarQube plugin nearly. How my plugin works and what it does is is not important so far. I just want to change one last thing.

How can i modify the name of my Sensor? I mean that one which is shown in Jenkins (my build environment) when the Sensor gets used. I want to show there only "Sensor ProjectKeyChecker..." or something like that if it possible :)

Here is an example output of Jenkins:

[INFO] [15:12:27.723] Sensor org.sonar.plugins.projectkeychecker.ProjectKeyCheckerSensor@79aa11...
[INFO] [15:12:27.786] Project exists already on Sonar. Key check is unnecessary.
[INFO] [15:12:27.786] Sensor org.sonar.plugins.projectkeychecker.ProjectKeyCheckerSensor@79aa11 done: 63 ms

Thank you all :)


回答1:


IIRC, you just have to implement the #toString() method.



来源:https://stackoverflow.com/questions/22690521/how-to-change-sensor-name-of-self-developed-sonar-plugin-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!