Offload the cargo at sea to another boat? Barring that, flood it compartment by compartment and pump the fluid into other boats (to be later dried and re-packaged) or into the ocean (the ocean is big). Then bring the ship in to repair the hull or to salvage it.QED.
This can all be done at sea. Of course, someone has to pay.
This can all be done at sea. Of course, someone has to pay.