A terrorist who infiltrated the British military and supplied bombs to dissident Irish republicans has been jailed for 18 years.