I have examined previous releases and found out this issue affects all released BPMS versions since 6.0.0. Looks like bug 1011522 was only fixed for BRMS.
Created attachment 942828 [details]
all log of build action
I have take some tests, the project build when I add Knowledge Sessions (Stateful and Stateless), but if I create another project and add dependence with this one and add a default kbase, the project does not build. See log.
In the test, the Project2 depends of Project1. If in the Project1 I do not set a kBase as default the project build fine, but in my code when I try load a kieBase from the Project2 (org.kie.api.runtime.KieContainer.getKieBase()) create a default kBase of the Project1, and I can't read packages/facts from a Project2..
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseId = kieServices.newReleaseId("org.kie.test", "project2", "1.0");
KieContainer kieContainer = kieServices.newKieContainer(releaseId);
KieBase kBase = kieContainer.getKieBase(); // This code load a default kie base from a project1.
by making a dependency between kbases/kjars you effectively asking them to be merged and thus you can get hold of them from within same kieContainer. That's why they can be named so you can reference them directly to get the one you need. In my opinion this is expected.
Lowering severity / priority as this seems to be working as expected. If the error message needs to be improved (note it has already been improved a little in https://github.com/droolsjbpm/jbpm/commit/0739459d7d38179b88ceb45688473fbc535929c9), please let us know what you believe might be better.
I believe that, Independent of hierarchical dependencies, when I call method getKieBase() from a project, I want a default KieBase of this project and not from a dependencies of this project.
Supposing that I have 2 projects, ProjA and ProjB, where ProjB depends of ProjA and each project have your default KieBase. When I load a KieContainer from ProjB and request a default KieBase (method getKieBase()) I expect that it returns a KieBase from ProjB and not from ProjA, seeing that I load KieContainer of ProjB and not from ProjA.
if you have both kjars with default kbase set kieCOntainer will disable completely retrieval of default kbase as it won't be able to figure out which one to use. So if there is only one marked as default it will be returned regardless of what jar it comes from.
for that kind of advanced deployment configuration 'Process Deployemnts'perspective shall be used. That's why there are various options to build (build and install vs build and deploy) is to allow users to not experience any errors in case they have more advanced setup.
I am in favor of not duplicating functionality and use build and deploy strictly to deploy default configuration.
I think that is better do not duplicate and use default config to build and deploy too.
About comment 10, I have other principles to believe that this is not a right things to do.