use of org.appformer.maven.integration.DependencyDescriptor in project drools by kiegroup.
the class KieRepositoryScannerImpl method setKieContainer.
public synchronized void setKieContainer(KieContainer kieContainer) {
if (this.kieContainer != null) {
throw new RuntimeException("Cannot change KieContainer on an already initialized KieScanner");
}
this.kieContainer = (InternalKieContainer) kieContainer;
if (this.kieContainer.getContainerReleaseId() == null) {
throw new RuntimeException("The KieContainer's ReleaseId cannot be null. Are you using a KieClasspathContainer?");
}
artifactResolver = getResolverFor(this.kieContainer, true);
kieProjectDescr = new DependencyDescriptor(this.kieContainer.getReleaseId(), this.kieContainer.getCreationTimestamp());
usedDependencies = indexArtifacts();
KieScannersRegistry.register(this);
changeStatus(Status.STOPPED);
if (MBeanUtils.isMBeanEnabled()) {
mbean = new KieScannerMBeanImpl(this);
}
}
use of org.appformer.maven.integration.DependencyDescriptor in project drools by kiegroup.
the class KieRepositoryScannerImpl method indexArtifacts.
private Map<ReleaseId, DependencyDescriptor> indexArtifacts() {
Map<ReleaseId, DependencyDescriptor> depsMap = new HashMap<ReleaseId, DependencyDescriptor>();
for (DependencyDescriptor dep : artifactResolver.getAllDependecies()) {
if (!"test".equals(dep.getScope()) && !"provided".equals(dep.getScope()) && !"system".equals(dep.getScope())) {
Artifact artifact = artifactResolver.resolveArtifact(dep.getReleaseId());
log.debug(artifact + " resolved to " + artifact.getFile());
if (isKJar(artifact.getFile())) {
depsMap.put(adapt(dep.getReleaseIdWithoutVersion()), new DependencyDescriptor(artifact));
}
} else {
log.debug("{} does not need to be resolved because in scope {}", dep, dep.getScope());
}
}
return depsMap;
}
Aggregations