2 Replies Latest reply on Apr 10, 2008 10:06 PM by Siarhei Dudzin

    how to develop seam project with maven?

    Sean Wu Newbie

      Hi all,


      I was asked to give a simple demo of seam that using Maven as project management tool and Continuum as CI Server to show an agile way. Now I notice that in book and dvd store examples of seam2.0.2RC has pom.xml files that indicates I can create seam project with Maven, but the information is not enough for me. After googling, I found some articles but they seemed out of date. So I have to ask here:


      1. Is there any maven archetype plugin available? The softeu solution seems does not work anymore


      2. How do these book and dvdstore be recreated with maven? There seems an argument that now we have to set seam as the parent pom. In my case, I accept this, but how to create it in detail?


      Any help will be appreciated!

        • 1. Re: how to develop seam project with maven?
          Sander S Newbie

          I'm also using maven for seam. I dont have an archtype but the structure is a followed:



          • src/main/java - all classes/components etc

          • src/main/resources - META-INF/persistence.xml and seam.properties

          • src/main/webapp all other stuff



          this is if you are deploying seam as a war. I you are deploying an EAR make another (sub)project for the EJB and the EAR packaging and in the war make some dependencies provided as they are being packaged by the EAR


          My pom for a WAR project is as followed:
          Please note that some other users noticed that upgrading to the new hibernate version (3.2.6) brings in a lot of other unwanted dependencies but i've not updated yet.


          <?xml version="1.0" encoding="UTF-8"?>
          <project ....
               <packaging>war</packaging>
          
               <build>
                    <plugins>
                         <plugin>
                              <artifactId>maven-compiler-plugin</artifactId>
                              <configuration>
                                   <source>1.6</source>
                                   <target>1.6</target>
                                   <debug>true</debug>
                              </configuration>
                         </plugin>
          
                         <!-- war building -->
                         <plugin>
                              <groupId>org.apache.maven.plugins</groupId>
                              <artifactId>maven-war-plugin</artifactId>
                              <version>2.0.2</version>
                              <executions>
                                   <execution>
                                        <id>make-war</id>
                                        <phase>install</phase>
                                        <goals>
                                             <goal>war</goal>
                                        </goals>
                                   </execution>
                              </executions>
                         </plugin>
                    </plugins>
               </build>
          
               <dependencies>
                    
                    <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam</artifactId>
                         <version>${seam-version}</version>
                    </dependency>
                    <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam-ioc</artifactId>
                         <version>${seam-version}</version>
                    </dependency>
                    <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam-ui</artifactId>
                         <version>${seam-version}</version>
                    </dependency>
                    <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam-remoting</artifactId>
                         <version>${seam-version}</version>
                    </dependency>
                    
                    <dependency>
                         <groupId>org.hibernate</groupId>
                         <artifactId>hibernate</artifactId>
                         <version>3.2.5.ga</version>
                    </dependency>
                    <dependency>
                         <groupId>org.hibernate</groupId>
                         <artifactId>hibernate-annotations</artifactId>
                         <version>3.3.0.ga</version>
                    </dependency>
                    <dependency>
                         <groupId>org.hibernate</groupId>
                         <artifactId>hibernate-validator</artifactId>
                         <version>3.0.0.ga</version>
                    </dependency>
                    
                    <dependency>
                         <groupId>com.sun.facelets</groupId>
                         <artifactId>jsf-facelets</artifactId>
                         <version>1.1.14</version>
                    </dependency>
                    <dependency>
                         <groupId>javax.faces</groupId>
                         <artifactId>jsf-api</artifactId>
                         <version>1.2_08</version>
                    </dependency>
                    <dependency>
                         <groupId>javax.faces</groupId>
                         <artifactId>jsf-impl</artifactId>
                         <version>1.2_07</version>
                    </dependency>
          
                    <dependency>
                         <groupId>org.richfaces.framework</groupId>
                         <artifactId>richfaces-api</artifactId>
                         <version>${rich-faces-version}</version>
                    </dependency>
                    <dependency>
                         <groupId>org.richfaces.framework</groupId>
                         <artifactId>richfaces-impl</artifactId>
                         <version>${rich-faces-version}</version>
                    </dependency>
                    <dependency>
                         <groupId>org.richfaces.ui</groupId>
                         <artifactId>richfaces-ui</artifactId>
                         <version>${rich-faces-version}</version>
                    </dependency>
               </dependencies>
          
               <repositories>
                    <repository>
                         <id>jboss</id>
                         <url>http://repository.jboss.org/maven2</url>
                    </repository>
               </repositories>
          
               <properties>
                    <seam-version>2.0.1.GA</seam-version>
                    <rich-faces-version>3.1.4.GA</rich-faces-version>
               </properties>
          </project>
          
          

          • 2. Re: how to develop seam project with maven?
            Siarhei Dudzin Apprentice

            This is the latest status (at least known to me) http://jira.jboss.com/jira/browse/JBSEAM-2371. It's not a big deal to create a maven project, however make integration tests work is a challenge due to the way Seam (and probably JBoss embedded) is designed.