OK, the Treaty of the EU does have a mutual defence clause but the military is specifically out of scope.
Considering the huge ramifications of EU membership in all areas it still does seem ridiculously onerous if you are "just" after security and NATO-like alliances.