使用Sonar Web Service Java客户端



这是我第一次使用Sonar Web Service Java客户端。我已经成功下载了jar文件,并且在执行时没有任何错误

Sonar sonar = Sonar.create("http://localhost:9000", "login", "password");

然而,当我执行时:

Resource struts = sonar.find(ResourceQuery.createForMetrics(resourceKey,"violations"));

struts为空。我不确定我做错了什么。请要求我添加所需的任何其他信息。

变量"resourceKey"可能没有指向有效的资源。

项目的资源键可以在其主Sonar面板上的描述小部件中找到。例如,在Nemo上,您可以在其面板上找到struts2的资源键:"org.apache.Struts:struts2-parent"。

如果资源是一个文件,则必须将资源路径附加到其项目密钥。例如:org.apache.struts:struts2核心:org.apache.struts2.util.StrutsUtil

相关内容

最新更新