2 Replies Latest reply on Sep 25, 2012 11:57 AM by Guillermo Fernandez

    jboss-deployment-structure.xml in EAR using Maven

    di0nysus Newbie

      Hi all,

       

      I need to have a jboss-deployment-structure.xml-file inside the EAR of the project I'm working on. I have tried to put the file in src/main/resources/META-INF/jboss-deployment-structure.xml, but then it only ends up in target/classes/META-INF/jboss-deployment-structure.xml (not in the EAR) after running mvn clean install. Any ideas? I'm a novice JBoss AS 7 and Maven user.

       

      Thanks!

        • 1. Re: jboss-deployment-structure.xml in EAR using Maven
          di0nysus Newbie

          I figured it out myself. I moved the file to src/main/application and it was included in the EAR.

          • 2. Re: jboss-deployment-structure.xml in EAR using Maven
            Guillermo Fernandez Newbie

            Just for record.

             

            The default resource directory for an EAR is src/main/application, but this can be changed througth the earSourceDirectory property of the maven-ear-plugin like the next example.

             

            <plugin>

              <groupId>org.apache.maven.plugins</groupId>

              <artifactId>maven-ear-plugin</artifactId>

              <version>2.6</version>

              <configuration>

                <!-- Tell Maven we are using Java EE 6 -->

                <version>6</version>

                <!-- Use Java EE ear libraries as needed. Java EE ear libraries

                  are in easy way to package any libraries needed in the ear, and automatically

                  have any modules (EJB-JARs and WARs) use them -->

                <defaultLibBundleDir>EarContent/lib</defaultLibBundleDir>

                <earSourceDirectory>${basedir}/EarContent</earSourceDirectory>

                ....

              </configuration>

            </plugin>

             

            Regards