6 Replies Latest reply on Jun 2, 2008 9:24 AM by andre1001

    Maven X business_service quickstart

    andre1001

      Hi,

      what would be a better strategy to packaging applications like business_services quickstart with Maven?

      1) Create 3 projects. 1 pom which manages 1 .esb and 1 .jar?

      2) Create 1 project with all artifacts, and putting .jar inside .esb by configuring Maven lifecycle steps?

      Thanks.

        • 1. Re: Maven X business_service quickstart
          andre1001

          Does someone build .esb packages with Maven?

          • 2. Re: Maven X business_service quickstart
            tfennelly

            I know Kev built a maven plugin for doing this, but not sure where it is hosted now (hopefully he'll post).

            What I've done in the past and it worked OK (IMO), was to use maven plus a simple ant script to build the actual .esb archive. Use the maven assembly plugin to assemble the dependencies etc.

            • 3. Re: Maven X business_service quickstart
              tcunning

              Here's the link :

              http://mojo.codehaus.org/jboss-packaging-maven-plugin/

              I believe someone has an .esb archetype too - I'll ask around and see if someone can share the info about that.

              This is really more of a maven "best practices" question rather than esb one, I think the best practice in maven is that you have a parent pom that builds the .esb, and inside that parent project you have a example-jar sub-project which builds the jar.

              http://maven.apache.org/guides/getting-started/index.html#How_do_I_build_more_than_one_project_at_once

              • 4. Re: Maven X business_service quickstart
                andre1001

                tcunning/tfenelly,

                thanks for your answers. I would appreciate any poms/archetypes also. If I manage to get it working I'll post here.

                • 5. Re: Maven X business_service quickstart
                  kconner

                  We created a maven plugin and then donated it to the codehaus mojo project, TomC has already posted the link.

                  You should use your first suggestion and treat the construction of the esb artifact in a similar fashion to creating an ear. There is a packaging type associated with the plugin which, IIRC, is jboss-esb.

                  • 6. Re: Maven X business_service quickstart
                    andre1001

                     

                    "Kevin.Conner@jboss.com" wrote:
                    We created a maven plugin and then donated it to the codehaus mojo project, TomC has already posted the link.

                    You should use your first suggestion and treat the construction of the esb artifact in a similar fashion to creating an ear. There is a packaging type associated with the plugin which, IIRC, is jboss-esb.


                    Thanks Kevin.

                    I've also added a step in order to test application inside AS (integration-test phase).

                    Following the resultant pom:
                    <?xml version="1.0"?>
                     <project>
                     <parent>
                     <artifactId>NotasRoot</artifactId>
                     <groupId>com.testesoa</groupId>
                     <version>1.0-SNAPSHOT</version>
                     </parent>
                     <modelVersion>4.0.0</modelVersion>
                     <groupId>com.testesoa</groupId>
                     <artifactId>NotasESB</artifactId>
                     <name>NotasESB</name>
                     <version>1.0-SNAPSHOT</version>
                     <url>http://maven.apache.org</url>
                     <packaging>jboss-esb</packaging>
                     <build>
                     <filters>
                     <filter>../root/src/main/filters/filter.properties</filter>
                     </filters>
                     <resources>
                     <resource>
                     <directory>src/main/resources</directory>
                     <filtering>true</filtering>
                     </resource>
                     </resources>
                     <plugins>
                    
                     <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>jboss-maven-plugin</artifactId>
                     <version>1.3.1</version>
                     <executions>
                     <execution>
                     <id>jboss-undeploy-antes</id>
                     <phase>clean</phase>
                     <goals>
                     <goal>undeploy</goal>
                     </goals>
                     </execution>
                     <execution>
                     <id>jboss-deploy</id>
                     <phase>pre-integration-test</phase>
                     <goals>
                     <goal>deploy</goal>
                     </goals>
                     </execution>
                     <execution>
                     <id>jboss-undeploy-depois</id>
                     <phase>post-integration-test</phase>
                     <goals>
                     <goal>undeploy</goal>
                     </goals>
                     </execution>
                     </executions>
                     <configuration>
                     <jbossHome>${user.home}/java/jboss-4.2.2.GA</jbossHome>
                     <fileName>${project.build.directory}/${project.build.finalName}.esb</fileName>
                     </configuration>
                     </plugin>
                    
                     <plugin>
                     <artifactId>maven-antrun-plugin</artifactId>
                     <executions>
                     <execution>
                     <id>teste</id>
                     <phase>integration-test</phase>
                     <goals>
                     <goal>run</goal>
                     </goals>
                     <configuration>
                     <tasks>
                     <delete file="${my.dirs}/emp1/input/**"/>
                     <delete file="${my.dirs}/emp1/output/**"/>
                     <delete file="${my.dirs}/emp1/error/**"/>
                     <delete file="${my.dirs}/emp2/input/**"/>
                     <delete file="${my.dirs}/emp2/output/**"/>
                     <delete file="${my.dirs}/emp2/error/**"/>
                     <copy file="src/test/resources/Notas.xml"
                     tofile="src/test/resources/dirs/emp1/input/Notas.dat"/>
                     </tasks>
                     </configuration>
                     </execution>
                     </executions>
                     </plugin>
                    
                     <plugin>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <executions>
                     <execution>
                     <phase>test</phase>
                     <configuration>
                     <skipTests>true</skipTests>
                     </configuration>
                     </execution>
                     <execution>
                     <id>validacao</id>
                     <phase>integration-test</phase>
                     <goals>
                     <goal>test</goal>
                     </goals>
                     </execution>
                     </executions>
                     </plugin>
                    
                     </plugins>
                     </build>
                     <dependencies>
                     <dependency>
                     <groupId>com.testesoa</groupId>
                     <artifactId>NotasEJB</artifactId>
                     <version>1.0-SNAPSHOT</version>
                     </dependency>
                     </dependencies>
                    </project>