我有 5 个 EAR 需要部署。其中一个local-configuration-ear-0.3.5-SNAPSHOT.ear
是所有其他的依赖项,它们在部署时需要它,即local-configuration-ear-0.3.5-SNAPSHOT.ear
需要首先部署。所有 5 个 EAR 都位于该deployments
文件夹中。
我在这里读到了可以jboss-deployment-structure.xml
用来管理 EAR 部署顺序的文章,但是我遇到了一些问题。我制作的文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="deployment.local-configuration-ear-0.3.5-SNAPSHOT.ear" />
</dependencies>
</deployment>
</jboss-deployment-structure>
但在使用此描述符部署 EAR 后,我收到以下错误:
15:01:29,752 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.module.service."deployment.asterix-connector-ear-0.3.5-SNAPSHOT.ear".main: org.jboss.msc.service.StartException in s ervice jboss.module.service."deployment.asterix-connector-ear-0.3.5-SNAPSHOT.ear".main: Failed to load module: deployment.asterix-connector-ear-0.3.5-SNAPSHOT.ear:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) [rt.jar:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.6.0_24]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: org.jboss.modules.ModuleNotFoundException: deployment.local-configuration-ear-0.3.5-SNAPSHOT:main
at org.jboss.modules.Module.addPaths(Module.java:854)
at org.jboss.modules.Module.link(Module.java:1181)
at org.jboss.modules.Module.relink(Module.java:1211)
at org.jboss.modules.ModuleLoader.relink(ModuleLoader.java:445)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.relinkModule(ServiceModuleLoader.java:204) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
我做错了什么,有没有办法jboss-deployment-structure.xml
使用 Maven 生成,以便我可以以编程方式将版本号附加到我的 EAR 文件名?
编辑:
我也尝试将jboss-all.xml
文件添加到META-INF
,但没有帮助:
<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="local-configuration-ear-${project.version}.ear" />
</jboss-deployment-dependencies>
</jboss>
-<filtering>true</filtering>
在maven-ear-plugin
配置中。我检查了 EAR 存档,项目版本设置正确,但有时仍以不正确的顺序部署工件。