The issue with this is that by the time we are under attack it’s already too late to develop weapons. Most of the naval and air assets we used to fight World War II (the modern ur-example of a just conflict) were on the drawing board and planned, if not already in production, prior to Pearl Harbor. The problem is only magnified today where it takes years, not months, to build a ship, for example. Pledging to not work on weapons and other military projects absent a conflict is, in essence, a pledge never to work on weapons or military projects ever.