1
我有聲吶3.7.x的規則集備份,並且想要導入聲吶5.2。此規則集具有PMD,CheckStyle和Findbugs的規則。當我嘗試通過GUI時,導入沒有任何錯誤,但沒有導入規則(0規則)。然後我嘗試使用curl導入規則集的Sonar API。儘管結果(ruleFailures:600)顯示在XML中沒有導出600個規則中的任何規則(與GUI的行爲相同),但此命令也會成功。無法在聲吶中導入質量配置文件規則集5.2
-bash-4.1$ curl -X POST -u admin:admin -F "[email protected]_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}
我比較了我的文件聲納路的Java規則的出口,我不發現XML格式可能從3.x版變更爲5.x的任何聲納專家都可以幫助解決這個問題嗎?
您是否安裝了Checkstyle,PMD和FindBugs插件? IIRC,他們是3.2的一部分,但事實不再是這樣。 –
非常感謝G.Ann,事實上這一直是問題所在。我安裝了所有這些插件,因爲它們不再支持Squid。而且導入工作,但有一部分Sonar有點惱人,不能暗示我不導入規則的真正原因;) – dchucks