After some discussion about Switzerland, I came up with a theory on how to make a nation unconquerable by foreign foes, without a single man having to hold a rifle. That theory is the theory of Banks and Chocolate.
To begin with the banking part of this theory, the first step in this process is to create large, heavily regulated banks. The regulation of these banks has to do with privacy of foreign clients. By law every single of these banks must be have extreme restrictions on access to information. This is to draw investments from shady figures in foreign nations to invest their money in these banks. Then, you also want to develop in your banks a sense of stability. Each account should be completely insured in case of any economic crisis. This will draw clients from outside the country who want to keep at least a portion of their capital safe from economic crisis in their county. Finally it should be easy to evade taxes on the money put in these banks. Tax evasion by putting money in these banks should be completely encouraged, that is if they're evading taxes from their country. This will get more and more rich people to put money in accounts in these banks. How does this make your country unconquerable? Its simple, if the wealthy members of a country invest a lot of money in your country, they are pressured to make sure that money is not lost forever and since you would freeze their assets if you were invaded they will pressure their government to not take hostile actions against your nation. And we all know that the wealthy members of a society wield great influence.
The second part is chocolates. You need to gear your nation towards producing high quality items that are ubiquitous to everyday living. Items that become so common that they're taken for granted. That way if your nation is ever invaded, the price of those items will increase and the common person will fill the pull on their purse strings and the war will become less popular because of that...