Daron Acemoglu and Pierre Yared find that:
increased nationalist and militarist sentiments, measured by military spending and size, are negatively associated with trade. A country is less likely to open up to neighbours if the country is also becoming more militarised, and trade between two countries grows less rapidly when both countries become more militarised.
I wonder if this supports the idea that bilateral trade increases between countries if both free-ride off the military spending of a third benevolent hegemon.