This REST API does not report that the requested plugin version does not exist:
curl -v -X POST -d "<jenkins><install plugin=\"workflow-...@2.130\" /></jenkins>" -H "Content-Type: text/xml" "http://localhost:8080/pluginManager/installNecessaryPlugins"
The response does not indicate a problem:
Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8080 (#0) > POST /pluginManager/installNecessaryPlugins HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.47.0 > Accept: */* > Content-Type: text/xml > Content-Length: 65 > * upload completely sent off: 65 out of 65 bytes < HTTP/1.1 302 Found < Date: Sun, 21 Jul 2019 01:25:33 GMT < X-Content-Type-Options: nosniff < Location: http://localhost:8080/updateCenter < Content-Length: 0 < Server: Jetty(9.4.z-SNAPSHOT) < * Connection #0 to host localhost left intact
But the log does have a warning:
WARNING: No such plugin workflow-aggregator to upgrade
This makes automating plugin installation from the REST API very error prone.