From Universal Mind
War does accomplish all three of those in certain instances. It comes with a temporary giving up of degrees of those things, but the end result often makes nations come out way ahead of where they would be otherwise in all three areas.
Because you specifically mention self-defense separately, am I to assume that you are saying initiating an aggressive war can allow countries, in certain instances, to achieve far more than they could if they had only peace? I'd like to point out that peace is not a matter of degree. Countries are either at peace or at war. Similarly, though justice has degrees, it can never increase beyond the point that justice is fully carried out. Prosperity, on the other hand, is limitless, a direct consequence of the average volume of resources being used to better the conditions of each person. It is, however, mathematically impossible to sacrifice resources destructively and end up with more resources to spread around the same number of people, so perhaps you are referring to the cynical conclusion that there are less people sharing a proportionately greater amount of resources, so that average prosperity increases after a war.

I don't believe you're that cynical, so I'm assuming that you were only referring to self-defense, which you explicitly mention in the next quote.

From Universal Mind
Self-defense is one category of situations that can be exceptions to your generalized statement (Afghanistan against Soviet Union). The defense of others can be also (Gulf War). The defense of the world itself can be a primary justification (World War II). Overthrowing tyrranical governments before they stage attacks is another (initial battles in current Iraq war). Overthrowing a separate government that is merely oppressing your nation and has no plans of attacking it is another (the story of many ancient wars). So is fighting to keep a nation together (American Civil War). Fighting to end the genocide of people of another nation is another exception (a hypothetical war against the government of Sudan).
Fortunately, I already addressed self-defense. Pointing this out as an exception to my statement completely misses the vast majority of the content in my recent posts.