在 SonarQube 5.1.2 中使用 Web 服务 API 发布时,“'resource' 未被识别为内部或外部命令”
"'resource' is not recognized as an internal or external command" while POSTing using Web Service API in SonarQube 5.1.2
我在 Windows 7 Professional 上使用 SonarQube 5.1.2。我在 cURL 7.32.0 (x86_64-pc-win32) 上使用 Web 服务 API。我想使用 POST.
为特定项目上传 sonar.exclusions 和更多此类属性
我使用 curl -u admin:admin -X POST http://localhost:9512/api/prop
erties/?id=sonar.exclusions -v -T "D:\sonar-exclusions.xml"
并且我能够 POST 它作为全局 sonar.exclusions。
好像我使用 resource
到 post 到一个特定项目的命令 - curl -u admin:admin -X POST http://localhost:9512/api/prop
erties/?id=sonar.exclusions&resource=org.myProject:myProject -v -T "D:\sonar-exclusions.xml"
我收到错误 {"err_code" :200,"err_msg":"property created"}'resource' 不被识别为
内部或外部命令、可运行程序或批处理文件
这里的resource
参数有什么问题?
问题出在 URL 中的 &
,它被您的命令行提示符打断为:让我 运行 这个命令:
curl -u admin:admin -X POST http://localhost:9512/api/properties/?id=sonar.exclusions
然后 运行 这个命令:
resource=org.myProject:myProject -v -T "D:\sonar-exclusions.xml"
第一个 returns {"err_code":200,"err_msg":"property created"}
而第二个必然会失败:
'resource' is not recognized as an internal or external command, operable program or batch file
您应该转义 &
或简单地将 URL 放在 "quotes".
之间
我在 Windows 7 Professional 上使用 SonarQube 5.1.2。我在 cURL 7.32.0 (x86_64-pc-win32) 上使用 Web 服务 API。我想使用 POST.
为特定项目上传 sonar.exclusions 和更多此类属性我使用 curl -u admin:admin -X POST http://localhost:9512/api/prop
erties/?id=sonar.exclusions -v -T "D:\sonar-exclusions.xml"
并且我能够 POST 它作为全局 sonar.exclusions。
好像我使用 resource
到 post 到一个特定项目的命令 - curl -u admin:admin -X POST http://localhost:9512/api/prop
erties/?id=sonar.exclusions&resource=org.myProject:myProject -v -T "D:\sonar-exclusions.xml"
我收到错误 {"err_code" :200,"err_msg":"property created"}'resource' 不被识别为
内部或外部命令、可运行程序或批处理文件
这里的resource
参数有什么问题?
问题出在 URL 中的 &
,它被您的命令行提示符打断为:让我 运行 这个命令:
curl -u admin:admin -X POST http://localhost:9512/api/properties/?id=sonar.exclusions
然后 运行 这个命令:
resource=org.myProject:myProject -v -T "D:\sonar-exclusions.xml"
第一个 returns {"err_code":200,"err_msg":"property created"}
而第二个必然会失败:
'resource' is not recognized as an internal or external command, operable program or batch file
您应该转义 &
或简单地将 URL 放在 "quotes".