Work to safeguard a harbour against coastal erosion is now complete.