It would be an additional cost, but it might make sense to require that military contractors include full documentation of production methods with their products. There could be odd measures like keeping the records sealed for a time to protect secrets, but it seems like anything the nation needs to defend its interests should not be left in the hands of the producers who are expected to abandon it.