KieRepository kr = ks.getRepository();
KieModule kModule = kr.addKieModule(ks.getResources().newFileSystemResource(sourceFolder));
KieContainerImpl kContainer = (KieContainerImpl) ks.newKieContainer(kModule.getReleaseId());
KieProject kieProject = kContainer.getKieProject();
ResultsImpl messages = kieProject.verify();
List<Message> errors = messages.filterMessages(Message.Level.ERROR);
if (!errors.isEmpty()) {
for (Message error : errors) {
getLog().error(error.toString());