何时以及为什么我需要一个Spring应用程序的jboss-deployment-structure.xml? [英] When and why would I need a jboss-deployment-structure.xml for a Spring application?
问题描述
我试图了解如何在Spring应用程序中使用JBoss EAP6。我有一个示例OpenShift应用程序,它包含一个 jboss-deployment-structure.xml
文件。
I am trying to understand how to use JBoss EAP6 with Spring applications. I have a sample OpenShift application and it contains a jboss-deployment-structure.xml
file.
我发现了一些有关此文件的文档,但我不清楚为什么以及何时应该将这些文件与Spring应用程序一起使用。内容如下:
I found some documentation about this file, but I am not clear why and when one should use those files with Spring applications. The content is the following:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="com.h2database.h2"/>
<module name="org.codehaus.jackson.jackson-core-asl"/>
<module name="org.codehaus.jackson.jackson-mapper-asl"/>
<module name="org.slf4j"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
为什么需要声明对模块的依赖?什么是JBoss范例中的模块?是否有可能没有这个xml文件?
Why does one need to declare dependencies to modules? And what are modules in the JBoss paradigm? Is it possible to live without this xml file?
推荐答案
只要你的应用程序没有任何类加载问题你就可以了不需要jboss-deployment-structure.xml文件。但是一旦遇到这种麻烦,jboss-deployment-structure.xml中的依赖管理就会成为你的朋友。
As long as you don't have any classloading problems with your application you don't need the jboss-deployment-structure.xml file. But once you have trouble of such kind the dependency management in jboss-deployment-structure.xml would be your friend.
本文解释了很好的模块是。
我想简而言之,你可以说所有部署为WAR,JAR或EAR是一个模块。这些模块称为动态模块。除了它们之外,$ JBOSS_HOME / modules中还有静态模块。唯一的区别是它们是如何打包的。
I think in short you can say that everything that is deployed as WAR, JAR or EAR is a module. These modules are referred to as dynamic modules. Beside them there are static modules in $JBOSS_HOME/modules. The only difference is how they are packaged.
这篇关于何时以及为什么我需要一个Spring应用程序的jboss-deployment-structure.xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!