Mateusz W., a student at the Catholic University of Lublin, wanted to commit an attack using explosives and planned to join a terrorist organisation, officials said.