Closed sslavic closed 9 years ago
Hi @sslavic. Thanks for the report. I can not really reproduce it. The VersionEye servers are all running and the API is up as well. The project you tried it with, is it open source? That would help to reproduce the bug. But you are right with the error handling, that has room for improvement :-) That will happen soon. In case your project is not open source can you please run this command in your project:
mvn versioneye:json
That will create a pom.json
file in the target directory. Please send me that file via email to reiz @ versioneye.com. I will delete it after I found the bug.
Server is already back up/accessible and without any modifications in pom.xml versioneye:update works.
Bug is in versioneye-maven-plugin's HttpUtils.post method - it should check for status of HttpResponse and in case of non 2xx response code throw meaningful exception. Now, when proxy in between versioneye server and client (maven/plugin), responded with error html page and 504 http status code, HttpUtils.post just passed back response body, which UpdateMojo tried to interpret as JSON string, and parsing html as json failed with JsonParseException being thrown.
@sslavic Just thought it's a good time to work on this ticket :-) Feel free to test it. You can build it with:
mvn clean install
And then just use the 3.1.1-SNAPSHOT
version in your projects. I will add a couple more features before releasing it to mvn central.
Switched to sbt, looking forward to rtimush/sbt-updates#35
Should be easy to reproduce the issue in a test with mock server, which to update request returns non-200 response code with html page as response body.
That's how it works. The plugin checks the response code, if it's not 200 it displays the error message from the server in the command line. I will close this ticket and check the sbt ticket.
I just had a build fail when performing versioneye:update
At first I thought maybe there's something wrong with my POMs - but Maven build would fail early in that case. Then I found out that versioneye server is not accessible through browser, it's returning 504.
Now (3.1.0), update mojo seems to try to process response body as JSON, even when response is not 2xx, which results in this misleading and not informative stack trace.
Please fix plugin, update mojo, so that it handles better server error condition, with more informative exception and error message.