Virtually any platform for firing artillery today has a counter battery radar componet. Within seconds you know the exact position where a shell or missile originated. The instant that missile crossed the horizion the ship had its launch pad pinpointed. A cruise missile only needs the coordinates installed, it flies to them and boom.
Ed
Ed