With that dependency, you have made available more than one resource with the same name in the classpath of that application. As a result, the classloader.getResource() returns the first one it finds in the classpath (note, there's a different classloader.getResources() method which returns more than one such resources which are found in the classpath).
I am not sure what the classloader policy is in JBoss Modules when it scans for resources (i.e. whether it checks for dependencies first or itself).
yes you are right. When using the getClassloader().getResources() method, it returns two different resource.properties URLs. This clarifies everything, thanks a lot.
I would like to add that this behavior is, from my point of view not very intuitive. I would always guess that even when there are multiple resources with the same name in the same location in different deployment units, where one depends on the other, the resource from the dependent is taken.
The JBoss 6 does also find two resources when using getClassloader().getResources(), however the behaivor is as expected, the resource from the dependent is returned.