use of org.appformer.maven.support.AFReleaseId in project drools by kiegroup.
the class KieBuilderImpl method init.
private PomModel init() {
KieServices ks = KieServices.Factory.get();
results = new ResultsImpl();
// if pomXML is null it will generate a default, using default ReleaseId
// if pomXml is invalid, it assign pomModel to null
PomModel pomModel = getPomModel();
// if kModuleModelXML is null or invalid it will generate a default kModule, with a default kbase name
buildKieModuleModel();
if (pomModel != null) {
// creates ReleaseId from build pom
// If the pom was generated, it will be the same as teh default ReleaseId
releaseId = pomModel.getReleaseId();
// add all the pom dependencies to this builder ... not sure this is a good idea (?)
KieRepositoryImpl repository = (KieRepositoryImpl) ks.getRepository();
for (AFReleaseId dep : pomModel.getDependencies(DependencyFilter.COMPILE_FILTER)) {
KieModule depModule = repository.getKieModule(adapt(dep), pomModel);
if (depModule != null) {
addKieDependency(depModule);
}
}
} else {
// if the pomModel is null it means that the provided pom.xml is invalid so use the default releaseId
releaseId = KieServices.Factory.get().getRepository().getDefaultReleaseId();
}
return pomModel;
}
use of org.appformer.maven.support.AFReleaseId in project drools by kiegroup.
the class KieModuleMetaDataImpl method init.
private void init(ArtifactResolver artifactResolver) {
if (artifactResolver == null) {
return;
}
if (releaseId != null) {
addArtifact(artifactResolver.resolveArtifact(releaseId));
}
if (kieModule != null && kieModule.getPomModel() != null) {
for (AFReleaseId releaseId : kieModule.getPomModel().getDependencies(dependencyFilter)) {
addArtifact(artifactResolver.resolveArtifact(releaseId));
}
} else {
for (DependencyDescriptor dep : artifactResolver.getAllDependecies(dependencyFilter)) {
addArtifact(artifactResolver.resolveArtifact(dep.getReleaseId()));
}
}
packages.addAll(classes.keySet());
packages.addAll(rulesByPackage.keySet());
}
Aggregations