maven-2 – maven ear plugin没有拿起application.xml

我正在使用jbosscc-seam-archtype 1.2,我将application.xml放在EAR项目中,位于/ src / main / application / META-INF /下,但是maven-ear-plugin并没有把它拿起来.有什么建议吗?

这是我的maven EAR插件的片段:

<plugins>
    <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <version>5</version>    
                <modules>
                    <webModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-war</artifactId>
                        <contextRoot>***</contextRoot>
                        <unpack>${exploded.war.file}</unpack>
                    </webModule>

                    <jarModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-datamodel</artifactId>
                        <includeInApplicationXml>true</includeInApplicationXml>
                    </jarModule>

                    <ejbModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-bootstrap</artifactId>
                        <excluded>${exclude.bootstrap}</excluded>
                    </ejbModule>

                    <ejbModule>
                        <groupId>org.jboss.seam</groupId>
                        <artifactId>jboss-seam</artifactId>
                    </ejbModule>

                    <jarModule>
                        <groupId>org.jboss.el</groupId>
                        <artifactId>jboss-el</artifactId>
                        <bundleDir>lib</bundleDir>
                    </jarModule>

                </modules>

                <jboss>
                    <version>${version.jboss.app}</version>
                    <loader-repository>***:app=ejb3</loader-repository>
                </jboss>
            </configuration>
        </plugin>

我究竟做错了什么?

最佳答案
默认情况下,即使您将application.xml包含在maven ear项目中的src / main / application / META-INF / application.xml中也不会被选中,因为它将由< configuration>中指定的配置自动生成.如果您希望包含您的内容,则需要将generateApplicationXml更改为false(默认为true).

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.4.2</version>
    <configuration>
        <version>6</version>
        <displayName>MyEAR</displayName>
        <defaultLibBundleDir>lib</defaultLibBundleDir>
        <modules>
            <webModule>
                <groupId>com.test</groupId>
                <artifactId>my-web</artifactId>
                <bundleFileName>my-web.war</bundleFileName>
                <contextRoot>/MyWeb</contextRoot>
            </webModule>
        </modules>
        <generateApplicationXml>false</generateApplicationXml>            
    </configuration>
  </plugin>

转载注明原文:maven-2 – maven ear plugin没有拿起application.xml - 代码日志