If a Maven build includes a dependency for an artifact that is larger than 2 GB in size, the download of the artifact during the build terminates at 2 GB and the following error is reported by Maven:
[WARNING] Checksum validation failed, expected 5b0fafa21f2b3e9c4e3b7ef3c5306f82bcb9fc85 but is e9ef494d39de097b9a02531993688ceebdce39e1
Maven repeats the download a second time with the same error result, then build fails.
The failure is caused when the transfer method in AbstractWagon.java receives maxSize parameter, which is an integer, set to Integer.MAX_VALUE, rather than the actual size of the artifact. This value is then decremented to zero, which causes the download to terminate prematurely. The attached file (AbstractWagon.java) contains changes in the transfer method that use the value Integer.MAX_VALUE as a trigger that causes the routine to ignore the maxSize parameter's value and download the artifact until an EOF is detected, regardless of its size.