简体   繁体   English

在Sonar 5.2中无法导入质量配置文件规则集

[英]Unable to import Quality Profile Ruleset in Sonar 5.2

I have a backup of ruleset from Sonar 3.7.x and want to import into Sonar 5.2. 我从Sonar 3.7.x中备份了规则集,并想导入Sonar 5.2。 This ruleset has rules for PMD, CheckStyle and Findbugs. 该规则集具有PMD,CheckStyle和Findbugs的规则。 When I try through GUI the import works without any error but no rules are imported (0 rules). 当我尝试通过GUI进行导入时,没有任何错误,但是没有任何规则被导入(0条规则)。 Then I tried the Sonar API to import the ruleset using curl. 然后,我尝试使用Sonar API使用curl导入规则集。 Here also the command succeeds although the results (ruleFailures:600) show that no rules out of the 600 in the XML were imported (same behavior as the GUI). 尽管结果(ruleFailures:600)显示没有导入XML中600条规则之外的规则(与GUI行为相同),但命令在此也成功执行。

-bash-4.1$ curl -X POST -u admin:admin -F "backup=@My_standard_java_600.xml" -v http://XX.XX.40.70:9080/api/profiles/restore
* About to connect() to XX.XX.40.70 port 9080 (#0)
* Trying XX.XX.40.70... connected
* Connected to XX.XX.40.70 (XX.XX.40.70) port 9080 (#0)
* Server auth using Basic with user 'admin'
> POST /api/profiles/restore HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: XX.XX.40.70:9080
> Accept: */*
> Content-Length: 105883
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------b413fb6533eb
>
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=CE9FC5FE32939BE5ECC4FC64324B238D; Path=/; HttpOnly
< X-Runtime: 16162
< ETag: "c48a79cd01c8066aa814d5755e0c29ed"
< Cache-Control: private, max-age=0, must-revalidate
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Content-Type: application/json;charset=utf-8
< Content-Length: 194
< Date: Wed, 02 Dec 2015 15:16:15 GMT
<
* Connection #0 to host XX.XX.40.70 left intact
* Closing connection #0
{"profile":{"key":"java-my-standard-63451","name":"My Standard","language":"java","isDefault":false,"isInherited":false,"languageName":"Java"},"ruleSuccesses":0,"ruleFailures":600}

I compared the Sonar-way Java rule export with my file and I don't find that the XML format may have changed from v3.x to 5.x. 我将Sonar-way Java规则导出与我的文件进行了比较,但我发现XML格式可能不会从v3.x更改为5.x。 Can any Sonar expert please help troubleshoot this issue? 声纳专家可以帮助解决此问题吗?

As pointed out by G.Ann's comments above the issue pertained to missing Findbugs, Checkstyle and PMD plugins in the new Sonar 5.2 installation as they are no longer supported out of the box in favor of Squid. 正如G.Ann在上述评论中所指出的,该问题与新Sonar 5.2安装中缺少的Findbugs,Checkstyle和PMD插件有关,因为不再支持开箱即用的Squid。 Once installed the import worked, though bit annoying on part of Sonar to not hint to the real cause for not importing the rule. 安装完成后,导入工作正常,尽管Sonar的部分内容令人烦恼,但并未暗示未导入规则的真正原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM