[jboss-as7-dev] META-INF directory in dependency modules

Marius Bogoevici marius.bogoevici at gmail.com
Tue Apr 19 01:36:00 EDT 2011


Hi,
I have couple of questions regarding access to resources in imported 
modules. I noticed the following:

1) Assume that there's a module X, which contains resources under 
META-INF, eg. META-INF/x.foo
2) Deployment Y declares a dependency on module X (via 
META-INF/MANIFEST.MF 'Dependencies:') - to my best understanding the 
same would happen even if there was a module Y declaring a <dependency/> 
on X

If that is the case, the classloader of module Y  will be able to find 
resources contained in one of the jars of module X, except for anything 
undeneath META-INF - so META-INF/x.foo will not be found.

In summary:

classLoaderModuleY.getResources("META-INF/x.foo") , 0 results
classLoaderModuleY.getResources("META-INF") will basically return an 
entry for each and every JAR from dependencies
classLoaderModuleY.getResources("x/foo/bar/stuff") returns resource 
'stuff' found in package x.foo.bar exported by module X

Apart from META-INF/services which is treated in a special fashion, how 
is it possible to install and consume a set of libraries as modules 
(e.g. shared libraries), if they contain files underneath META-INF, 
since they are not accessible from within the referencing module? And 
why is there a default restriction on META-INF (the way I read the 
modules.xsd schema, this behaviour can never be overridden through the 
module definition)?

Thanks,
Marius



More information about the jboss-as7-dev mailing list