Closed shuk closed 6 years ago
This looks like the issue I'm having (issue #145). Check the file encoding of the corrupted jar. In my case it was updated to UTF-8, which explains why the file has grown in size (and why it has become corrupted).
Looks like this is an issue related to connect-livereload plugin.
this plugin will try to encode response content as a string, to see whether it is html content. if not it sends the encoded string as response which will corrupt the binary files.
https://github.com/intesso/connect-livereload/issues/39
As a workaround find connect-livereload/index.js in node_modules find the following function
function livereload(req, res, next) {
Add some logic so that your URL is not checked. Also you can add .jar pattern in ignore list.
But there is no correct solution as there are lot more other this depends on this feature.
Seems an upstream issue.
Some .jar files returns with incorrect length so returned .jar files are corrupted.
E.g. I hosted httpcore-4.2.1.jar as static content. The actual size is 223374 bytes http://central.maven.org/maven2/org/apache/httpcomponents/httpcore/4.2.1/httpcore-4.2.1.jar
But "grunt connect" returned httpcore-4.2.1.jar file as file with length 389046 bytes (corrupted file)!
On my local computer the jar file was located here: \web\plugins\scan-tool\lib\resteasy\httpcore-4.2.1.jar
And for hosting I used following code: