How to generate JBoss jboss-deployment-structure from maven dependencies

笑着哭i 提交于 2019-12-11 02:27:56

问题


We have project are built using maven. There are a lot of dependencies that is successfully resolved by good designed pom files. We need to generate sar module that we are planning to deploy on JBoss7AS. We have to describe all dependencies (including our modules) manually in file META-INF/jboss-deployment-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <resources>
            <resource-root path="lib/activemq-camel-5.6.0.jar"/>
            <resource-root path="lib/activemq-core-5.6.0.jar"/>
            <resource-root path="lib/activemq-pool-5.6.0.jar"/>
            <resource-root path="lib/activemq-protobuf-1.1.jar"/>
            <resource-root path="lib/ant-1.6.5.jar"/>
            <resource-root path="lib/antlr-2.7.6.jar"/>

And when we change version of any dependency in maven config we must change it manually in all our sar modules. Is there a way to generate such file automatically using maven capabilities Also maybe it's possible to avoid using this file at all? I'm noob in JBoss


回答1:


Check this plugin, maybe can help you Generate module.xml and jboss-deployment-structure.xml files for EAP6/JBossAS 7.

The official maven plugin wildfly-maven-plugin don't support this and exist one request to add a new goal.

Add goal to generate jboss-deployment-structure.xml #10




回答2:


add this to your maven ear plugin

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <targetPath>../${project.build.finalName}</targetPath>
        </resource>
    </resources>


来源:https://stackoverflow.com/questions/26477006/how-to-generate-jboss-jboss-deployment-structure-from-maven-dependencies

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