I isolated the issue sufficiently to this problem
BundleC
exports A, B
imports A
BundleD
exports A,
imports A, B
Both bundles will only resolve if one uses a self dependency.
I modified the code such that the Domain warns if a requirement resolves against multiple
modules
| Module firstMatch = null;
| for (Module other : modules)
| {
| List<Capability> capabilities = other.getCapabilities();
| if (capabilities != null)
| {
| for (Capability capability : capabilities)
| {
| if (capability.resolves(other, module, requirement))
| {
| if (firstMatch != null)
| {
| String otherName = other.getName() + ":" +
other.getVersion();
| String firstName = firstMatch.getName() + ":" +
firstMatch.getVersion();
| log.warn("Requirement " + requirement + " resolves
agaist " + firstName + " and " + otherName + " - using first.");
| }
| if (firstMatch == null)
| firstMatch = other;
| }
| }
| }
| }
|
and
| I extended the interface like this
|
| public interface Capability extends Serializable
| {
| /**
| * Whether this capability resolves the requirement
| *
| * @param capModule the capability module
| * @param reqModule the requirement module
| * @param requirement the requirement
| * @throws IllegalArgumentException for a null requirement
| * @return true when it is resolves the requirement
| */
| boolean resolves(Module capModule, Module reqModule, Requirement requirement);
| }
|
| which allows capability/requirement matching in the context of both modules.
|
|
| | public interface Capability extends Serializable
| | {
| | /**
| | * Whether this capability resolves the requirement
| | *
| | * @param capModule the capability module
| | * @param reqModule the requirement module
| | * @param requirement the requirement
| | * @throws IllegalArgumentException for a null requirement
| | * @return true when it is resolves the requirement
| | */
| | boolean resolves(Module capModule, Module reqModule, Requirement requirement);
| | }
| |
|
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254146#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...