sbt / sbt

sbt, the interactive build tool
https://scala-sbt.org
Apache License 2.0
4.8k stars 935 forks source link

Publish fails with large files - bug from ivy #2585

Open tomas-forsman opened 8 years ago

tomas-forsman commented 8 years ago

(See the guidelines for contributing, linked above)

steps

Try to "sbt publish" a large file > 1.1Gb data to a nexus repository.

problem

java.lang.OutOfMemoryError: Requested array size exceeds VM limit

Ivy reads the full byte array to calculate size to send, described in ivy bug https://issues.apache.org/jira/browse/IVY-1197

expectation

It should be possible to upload large files.

notes

remcobeckers commented 7 years ago

I am running into the same issue when publishing a large artifact (600+ MB) to our own Artifactory server. The work-around suggested in the Ivy bug report and on the Ivy distribution page (http://ant.apache.org/ivy/choose-distrib.html) is to put a very old version of Apache commons HttpClient on the classpath. However that work-around doesn't work for SBT. I managed to trace the cause back to this commit which seems to disable the possibility of using HttpClient completely: https://github.com/sbt/ivy/commit/ba72610c018ef6b640551964f61d79a480b4c4e4.