Defence ministers have announced a five-year collaboration in research against threats from potential adversaries, including hypersonic weapons.