com/stackoverflow/main
on ${WILDFLY_HOME}/modules
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.stackoverflow">
<resources>
<resource-root path="stackoverflow.jar"/>
</resources>
</module>
And now you have you module available to applications
For some reason you develop a new version of com.stackoverflow (say version 1.1), then you should:
com/stackoverflow/1.1
on ${WILDFLY_HOME}/modules
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.stackoverflow" slot="1.1">
<resources>
<resource-root path="stackoverflow.jar"/>
</resources>
</module>
Note the slot="1.1"
modification on this example
By default modules are placed on ${WILDFLY}/modules
directory but you can have more directories with modules, just edit your standalone.conf (or standalone.conf.bat if you are on Microsoft Windows) and properly set the variable JBOSS_MODULEPATH
For example in Unix/Linux/MacOSX:
JBOSS_MODULEPATH="$JBOSS_HOME/modules:$JBOSS_HOME/myownmodules1:$JBOSS_HOME/myownmodules2"
Or in Windows:
set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules;%JBOSS_HOME%\myownmodules1;%JBOSS_HOME%\myownmodules2"