use of org.drools.compiler.kie.builder.impl.ResultsImpl in project drools by kiegroup.
the class KieRepositoryScannerImpl method updateKieModule.
private boolean updateKieModule(DependencyDescriptor oldDependency, Artifact artifact) {
org.appformer.maven.support.AFReleaseId newReleaseId = new DependencyDescriptor(artifact).getReleaseId();
InternalKieModule kieModule = createKieModule(newReleaseId, artifact.getFile());
if (kieModule != null) {
addDependencies(kieModule, artifactResolver, artifactResolver.getArtifactDependecies(newReleaseId.toString()));
ResultsImpl messages = kieModule.build();
if (messages.filterMessages(Message.Level.ERROR).isEmpty()) {
Results updateMessages = kieContainer.updateDependencyToVersion(adapt(oldDependency.getArtifactReleaseId()), adapt(newReleaseId));
oldDependency.setArtifactVersion(artifact.getVersion());
// append all update Results into build Results to notify listeners
messages.getMessages().addAll(updateMessages.getMessages());
}
listeners.fireKieScannerUpdateResultsEventImpl(messages);
return !messages.hasMessages(Message.Level.ERROR);
}
return false;
}
use of org.drools.compiler.kie.builder.impl.ResultsImpl in project drools by kiegroup.
the class KieHelloWorldTest method testClassLoaderStore.
@Test
public void testClassLoaderStore() throws Exception {
// DROOLS-1766
String drl = "package org; declare Person name : String end";
KieServices ks = KieServices.Factory.get();
KieFileSystem kfs = ks.newKieFileSystem().write("src/main/resources/r1.drl", drl);
ks.newKieBuilder(kfs).buildAll();
KieContainer kcontainer = ks.newKieContainer(ks.getRepository().getDefaultReleaseId());
KieProject kieProject = ((KieContainerImpl) kcontainer).getKieProject();
ResultsImpl messages = kieProject.verify();
assertSame(kieProject.getClassLoader(), kcontainer.getClassLoader());
ProjectClassLoader pcl = ((ProjectClassLoader) kieProject.getClassLoader());
assertNotNull(pcl.getStore().get("org/Person.class"));
}
Aggregations