When and why would I need a jboss-deployment-structure.xml for a Spring application?

徘徊边缘 提交于 2019-11-30 10:59:57

问题


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.

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>

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?


回答1:


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.

This article explains very good what modules are.

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.




回答2:


This is what I found on the internet:

"In order to avoid using JBoss provided logging APIs, we need to place the following kind of “jboss-deployment-structure.xml” file inside “/home/userone/ApplicationLevelLog4jDemo/src” so that we can exclude the jboss logging APIs for our application and our application can use it’s own version of logging APIs."

Source: http://middlewaremagic.com/



来源:https://stackoverflow.com/questions/14581980/when-and-why-would-i-need-a-jboss-deployment-structure-xml-for-a-spring-applicat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!