It seems that in a future that isn't that far away, US carriers will have the ability to 3D-print repair parts or even miniature combat drones directly on board. At the moment, the US Navy is testing out the production of custom drones designed for special missions, which are being printed on board of the ships. The experiment is being carried out by researchers from the Naval Postgraduate School and the first drone has already been created on board the USS Essex last December. The printing instructions were transmitted on board via satellite link and the printer used the materials on board to make the parts (engine, GPS, radio, controller, etc.) which were then assembled by the sailor into a fully-functioning flying drone.
As you might have expected, the test demonstrated that such a feat isn't easy to achieve and the experiment had several obstacles to overcome. Probably the most important one was the fact that 3D printers are used inside shops, on solid ground, and aren't designed to work while in transit. This means that the device had to constantly compensate for the motion of the sailing ship in order to get the parts right. Furthermore, launching the drone from the ship, retrieving it and making sure that all these operations don't interfere with the ships radio or other sensor was also problematic.
However, according to Alan Jaeger, a faculty research associate at the school, the experiment was a success and the crew has had more problems controlling the drones than actually printing them: "Even with a small amount of wind, something this small will get buffeted around."