Ships can be designed to be difficult for mines to detect, to avoid detonating them.
A simpler variation of this technique, called wiping, was developed by Charles F. Goodeve which saved time and resources.