What might be more difficult to scale up is steel production https://en.wikipedia.org/wiki/List_of_countries_by_steel_pro...
Chips too, but old style boats without computers still float and maybe are even easier to build.
At one extreme a government can draft all the population into the military and send most of them to factories and farms. When the war is over, restart the civilian economy. A big mess for sure.
At the other extreme, the war is fought with contractors and volunteers and military factories have to compete with the civilian economy for workers, by raising salaries. This is what is happening in Russia AFAIK. They seem to be badly understaffed but even there the government must be careful if people become too unsatisfied.
So ultimately it's not economic reasons, is about winning the next election or staying alive.