无法将模块添加到 wildfly 9,加载引用它的 war 时找不到模块异常

Unable to add a module to wildfly 9, module not found exception when loading war that refers to it

在我的 WEB-INF 目录中 jboss-部署-structure.xml

<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="com.ticomgeo.crowbar" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

$JBOSS_HOME/modules/com/ticomgeo/crowbar/main modules.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.ticomgeo.crowbar">
    <resources>
        <resource-root path="properties"/>
    </resources>
</module>

war 文件部署失败,出现以下错误

2018-03-28 17:52:25,195 ERROR [org.jboss.msc.service.fail] (MSC service     thread 1-6) MSC000001: Failed to start service jboss.module.service."deployment.crowbar-server.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.crowbar-server.war".main: WFLYSRV0179: Failed to load module: deployment.crowbar-server.war:main
    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.modules.ModuleNotFoundException: com.ticomgeo.crowbar:main
    at org.jboss.modules.Module.addPaths(Module.java:1042)
    at org.jboss.modules.Module.link(Module.java:1398)
    at org.jboss.modules.Module.relinkIfNecessary(Module.java:1426)
    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:238)
    at  org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)
    ... 5 more

应该在一层。提供的是 system/layers/base 因此,在 $JBOSS_HOME/modules/system/layers/base/com/ticomgeo/crowbar/main 中创建文件应该可以正常工作。