Module of Modules?
kmark May 22, 2017 5:03 PMHello,
Apologies if this is not the proper forum to ask this question (it may be more JBoss Modules specific, but since I am using Wildfly exclusively, I wanted to check here first).
I am cleaning up the Modules for my Wildfly 10 instance and I wanted to add all of my Spring dependencies as one big module and then import that into my project. This seems to work, but then I had the idea to be even more flexible. I wanted to break apart all of my modules into individual modules and then tie them together with a placeholder module. Is this possible? I am running into weird issues when attempting to do this.
In other words, I would like to create a module directory, module.xml, etc. for each of the Spring jars (so you would have the module 'org.springframework.core', 'org.springframework.web', etc.) and then create a 'main' directory within the parent Spring directory and create the module 'org.springframework' which simply referenced the other Spring modules like so:
module.xml
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.3" name="org.springframework">
<dependencies>
<module name="org.springframework.jms" slot="4.3.2.RELEASE"/>
<module name="org.springframework.orm" slot="4.3.2.RELEASE"/>
<module name="org.springframework.aop" slot="4.3.2.RELEASE"/>
<module name="org.springframework.beans" slot="4.3.2.RELEASE"/>
<module name="org.springframework.context" slot="4.3.2.RELEASE"/>
<module name="org.springframework.core" slot="4.3.2.RELEASE"/>
<module name="org.springframework.web" slot="4.3.2.RELEASE"/>
<module name="org.springframework.oxm" slot="4.3.2.RELEASE"/>
....
....</dependencies>
</module>
directory structure
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-base
--org
---springframework
----aop
-----4.3.2.RELEASE
------module.xml
------spring-aop-4.3.2.RELEASE.jar
----aspects
-----4.3.2.RELEASE
------module.xml
------spring-aspects-4.3.2.RELEASE.jar
...
...
...
----main
-----module.xml
That way, in my Manifest, I would just have the one entry 'org.springframework' that referenced everything Spring related. This sort of works, but I get weird authentication issues (everything failing) and other errors that arise after the webapp loads successfully, making me think everything is working until you call the webapp.
Any insight here? Is packaging together modules something that can be done? Am I just doing it wrong? Are we instead supposed to declare each individual module in our Manifest?
Thanks for your time,
Kevin.