[jboss-as7-dev] META-INF directory in dependency modules
David M. Lloyd
david.lloyd at redhat.com
Tue Apr 19 09:58:22 EDT 2011
On 04/19/2011 12:36 AM, Marius Bogoevici wrote:
> Hi,
> I have couple of questions regarding access to resources in imported
> modules. I noticed the following:
[...]
> 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?
See below.
> And why is there a default restriction on META-INF
Because basically if you do:
someModule.getClassLoader().getResourceAsStream("/META-INF/MANIFEST.MF"), you
don't want to get the manifest of every transitive dependency, just the
module you query directly. Other files in META-INF act similarly.
> (the way I read the
> modules.xsd schema, this behaviour can never be overridden through the
> module definition)?
It can actually. Modules export all of their paths (including META-INF)
by default. The filtering happens on the import side because the filter
sequence for a module import contains some default entries at the end
which exclude META-INF. Now if you want to *include* some subpath of
META-INF, you may add an inclusive import filter which will override the
default exclusion. Like this:
...
<dependencies>
<module name="org.foo.bar">
<imports>
<include path="META-INF/mydirectory"/>
...
</imports>
</module>
...
</dependencies>
Right now we do not have support for filtering individual resource files
within a directory, but that is forthcoming [1].
[1] https://issues.jboss.org/browse/MODULES-69
--
- DML
More information about the jboss-as7-dev
mailing list