5 Replies Latest reply on Apr 2, 2012 9:50 AM by gebuh

    Info - Creating Seam project in Maven 2

    norad2

      A few months ago I setup a Seam project using Maven. There was very limited amount of Maven/Seam documentation and what was available didn't work. Looking back I thought I'd share how I accomplished this. I haven't really checked to see if there is more info for Maven now.


      Below is a working Maven configuration. My goal with this configuration was simply to mirror exactly the default build.xml that seam-gen creates. I am quite certain that many of the exclusions are not necessary, and that many improvements could be made to this. That being said, here is something to get you started with Maven and Seam.



      I have my project setup as 4 Maven modules



      • ProjectName

      • ProjectName-ear

      • ProjectName-jar

      • ProjectName-war




      ProjectName's pom.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
           <modelVersion>4.0.0</modelVersion>
           <groupId>com.company.component</groupId>
           <artifactId>projectName</artifactId>
           <version>1.0.0-1-SNAPSHOT</version>
           <name>${project.version} ${artifactId}</name>
           <description>A web interface for ...</description>
           <packaging>pom</packaging>
           <modules>
                <module>projectName-ear</module>
                <module>projectName-jar</module>
                <module>projectName-war</module>
           </modules>
      </project>
      



        • 1. Re: Info - Creating Seam project in Maven 2
          norad2

          ProjectName-ear's pom.xml


          <?xml version="1.0" encoding="UTF-8"?>
          <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
               <modelVersion>4.0.0</modelVersion>
               <groupId>com.company.component.projectName</groupId>
               <artifactId>projectName-ear</artifactId>
               <version>1.0.0-1-SNAPSHOT</version>
               <name>${project.version} ${artifactId}</name>
               <description>A web interface for ...</description>
               <parent>
                    <groupId>com.company.component</groupId>
                    <artifactId>projectName</artifactId>
                    <version>1.0.0-1-SNAPSHOT</version>
               </parent>
               <packaging>ear</packaging>
               <repositories>
                    <repository>
                         <name>JBoss</name>
                         <releases>
                              <enabled>true</enabled>
                         </releases>
                         <id>jboss</id>
                         <url>http://repository.jboss.com/maven2</url>
                    </repository>     
               </repositories>
               <build>
                    <plugins>
                         <plugin>
                              <groupId>org.apache.maven.plugins</groupId>
                              <artifactId>maven-ear-plugin</artifactId>
                              <version>2.2</version>
                              <configuration>
                                   <defaultJavaBundleDir>lib/</defaultJavaBundleDir>
                                   <finalName>${artifactId}</finalName>
                                   <modules>
                                        <javaModule>
                                             <groupId>org.jboss.seam</groupId>
                                             <artifactId>jboss-seam</artifactId>
                                             <bundleDir>/</bundleDir>
                                        </javaModule>
                                        <javaModule>
                                             <groupId>com.company.component.projectName</groupId>
                                             <artifactId>projectName-jar</artifactId>
                                             <bundleDir>/</bundleDir>
                                        </javaModule>
                                   </modules>
                              </configuration>
                         </plugin>
                    </plugins>
                    <resources>
                         <resource>
                          <directory>src/main/resources</directory>
                      </resource>
                      <resource>
                          <directory>src/main/config</directory>
                          <targetPath>../config</targetPath>
                          <filtering>true</filtering>
                      </resource>
                      <resource>
                          <directory>src/main/scripts</directory>
                          <targetPath>../scripts</targetPath>
                          <filtering>true</filtering>
                      </resource>
                      <resource>
                          <directory>src/main/</directory>
                          <targetPath>../</targetPath>
                          <filtering>true</filtering>
                      </resource>
                  </resources>
               </build>
               
               <dependencies>
                    <dependency>
                         <groupId>com.company.component.projectName</groupId>
                         <artifactId>projectName-jar</artifactId>
                         <version>${project.version}</version>
                         <exclusions>
                              <exclusion>
                                   <groupId>commons-beanutils</groupId>
                                   <artifactId>commons-beanutils</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>commons-digester</groupId>
                                   <artifactId>commons-digester</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-debug</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-ioc</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-mail</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-pdf</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-remoting</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-ui</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>com.sun.facelets</groupId>
                                   <artifactId>jsf-facelets</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.richfaces.framework</groupId>
                                   <artifactId>richfaces-impl</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.richfaces.ui</groupId>
                                   <artifactId>richfaces-ui</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.persistence</groupId>
                                   <artifactId>persistence-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.ejb</groupId>
                                   <artifactId>ejb-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-annotations</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-validator</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>dnsjava</groupId>
                                   <artifactId>dnsjava</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId> 
                                   <artifactId>jboss-seam</artifactId>
                              </exclusion>
                         </exclusions>
                    </dependency>
                    <dependency>
                         <groupId>com.company.component.projectName</groupId>
                         <artifactId>projectName-war</artifactId>
                         <version>${project.version}</version>
                         <type>war</type>
                         <exclusions>
                              <exclusion>
                                   <groupId>commons-beanutils</groupId>
                                   <artifactId>commons-beanutils</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>commons-digester</groupId>
                                   <artifactId>commons-digester</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-debug</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-ioc</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-mail</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-pdf</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-remoting</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>jboss-seam-ui</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>com.sun.facelets</groupId>
                                   <artifactId>jsf-facelets</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.richfaces.framework</groupId>
                                   <artifactId>richfaces-impl</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.richfaces.ui</groupId>
                                   <artifactId>richfaces-ui</artifactId>
                              </exclusion>
                         </exclusions>
                    </dependency>
                    <dependency>
                         <groupId>org.eclipse.jdt</groupId>
                         <artifactId>core</artifactId>
                         <version>3.2.3.v_686_R32x</version>
                    </dependency>
                    <dependency>
                         <groupId>org.drools</groupId>
                         <artifactId>drools-compiler</artifactId>
                         <version>4.0.3</version>
                         <exclusions>
                              <exclusion>
                                   <groupId>org.eclipse.jdt</groupId>
                                   <artifactId>core</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>com.thoughtworks.xstream</groupId>
                                   <artifactId>xstream</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>xml-apis</groupId>
                                   <artifactId>xml-apis</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>xerces</groupId>
                                   <artifactId>xercesImpl</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>group-c</groupId>
                                   <artifactId>excluded-artifact</artifactId>
                              </exclusion>
                         </exclusions>
                    </dependency>
                    <dependency>
                         <groupId>jboss</groupId>
                         <artifactId>jboss-el</artifactId>
                         <version>2.0.0.BETA1</version>
                    </dependency>
                    <dependency>
                         <groupId>jboss</groupId>
                         <artifactId>jbpm</artifactId>
                         <version>3.1.1</version>
                    </dependency>
                    <dependency>
                         <groupId>org.mvel</groupId>
                         <artifactId>mvel14</artifactId>
                         <version>1.2.21</version>
                    </dependency>
                    <dependency>
                         <groupId>org.richfaces.framework</groupId>
                         <artifactId>richfaces-api</artifactId>
                         <version>3.1.3.GA</version>
                         <exclusions>
                              <exclusion>
                                   <groupId>junit</groupId>
                                   <artifactId>junit</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>com.sun.facelets</groupId>
                                   <artifactId>jsf-facelets</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.el</groupId>
                                   <artifactId>el-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>commons-logging</groupId>
                                   <artifactId>commons-logging</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.servlet</groupId>
                                   <artifactId>servlet-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.servlet.jsp</groupId>
                                   <artifactId>jsp-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.faces</groupId>
                                   <artifactId>jsf-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>commons-collections</groupId>
                                   <artifactId>commons-collections</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>commons-beanutils</groupId>
                                   <artifactId>commons-beanutils</artifactId>
                              </exclusion>
                         </exclusions>
                    </dependency>
                    <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam</artifactId>
                         <version>2.0.1.GA</version>
                         <exclusions>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-annotations</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-validator</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-search</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-entitymanager</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>jboss</groupId>
                                   <artifactId>javassist</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>dom4j</groupId>
                                   <artifactId>dom4j</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.portlet</groupId>
                                   <artifactId>portlet-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.servlet</groupId>
                                   <artifactId>servlet-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.mail</groupId>
                                   <artifactId>mail</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.xml.ws</groupId>
                                   <artifactId>jaxws-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.jws</groupId>
                                   <artifactId>jsr181-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.faces</groupId>
                                   <artifactId>jsf-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.servlet.jsp</groupId>
                                   <artifactId>jsp-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.ejb</groupId>
                                   <artifactId>ejb-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.xml.soap</groupId>
                                   <artifactId>saaj-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.jms</groupId>
                                   <artifactId>jms</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.annotation</groupId>
                                   <artifactId>jsr250-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.transaction</groupId>
                                   <artifactId>jta</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>groovy</groupId>
                                   <artifactId>groovy-all</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>log4j</groupId>
                                   <artifactId>log4j</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.el</groupId>
                                   <artifactId>el-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.persistence</groupId>
                                   <artifactId>persistence-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>antlr</groupId>
                                   <artifactId>antlr</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.apache.ant</groupId>
                                   <artifactId>ant-antlr</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>jboss</groupId>
                                   <artifactId>jboss-cache</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>jboss</groupId>
                                   <artifactId>jboss-system</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>jboss</groupId>
                                   <artifactId>jboss-jmx</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>jgroups</groupId>
                                   <artifactId>jgroups</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.buni.meldware</groupId>
                                   <artifactId>meldware-mailjmx</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.buni.meldware</groupId>
                                   <artifactId>meldware-mailapi</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.drools</groupId>
                                   <artifactId>drools-core</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.drools</groupId>
                                   <artifactId>drools-compiler</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.testng</groupId>
                                   <artifactId>testng</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.dbunit</groupId>
                                   <artifactId>dbunit</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jbpm</groupId>
                                   <artifactId>jbpm-jpdl</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.el</groupId>
                                   <artifactId>jboss-el</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.jboss.seam.embedded</groupId>
                                   <artifactId>jboss-embedded-api</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>quartz</groupId>
                                   <artifactId>quartz</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>javax.faces</groupId>
                                   <artifactId>jsf-impl</artifactId>
                              </exclusion>
                              <exclusion>
                                   <groupId>org.tuckey</groupId>
                                   <artifactId>urlrewritefilter</artifactId>
                              </exclusion>
                         </exclusions>
                    </dependency>
               </dependencies>
          </project>
          

          • 2. Re: Info - Creating Seam project in Maven 2
            norad2

            ProjectName-jar's pom.xml


            <?xml version="1.0" encoding="UTF-8"?>
            <project xmlns="http://maven.apache.org/POM/4.0.0"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                 <modelVersion>4.0.0</modelVersion>
                 <groupId>com.company.component.projectName</groupId>
                 <artifactId>projectName-jar</artifactId>
                 <version>1.0.0-1-SNAPSHOT</version>
                 <name>${project.version} ${artifactId}</name>
                 <description>A web interface for ...</description>
                 <parent>
                      <groupId>com.company.component</groupId>
                      <artifactId>projectName</artifactId>
                      <version>1.0.0-1-SNAPSHOT</version>
                 </parent>
                 <packaging>jar</packaging>
                 <repositories>
                      <repository>
                           <name>JBoss</name>
                           <releases>
                                <enabled>true</enabled>
                           </releases>
                           <id>jboss</id>
                           <url>http://repository.jboss.com/maven2</url>
                      </repository>
                 </repositories>
                 <build>
                      <plugins>
                           <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
                                <version>2.2</version>
                                <configuration>
                                     <finalName>${artifactId}</finalName>
                                </configuration>
                                <executions>
                                     <execution>
                                          <id>make-jar</id>
                                          <phase>install</phase>
                                          <goals>
                                               <goal>jar</goal>
                                          </goals>
                                     </execution>
                                </executions>
                           </plugin>
                      </plugins>
                 </build>
                 <dependencies>
                      <dependency>
                           <groupId>commons-beanutils</groupId>
                           <artifactId>commons-beanutils</artifactId>
                           <version>1.6</version>
                      </dependency>
                      <dependency>
                           <groupId>commons-digester</groupId>
                           <artifactId>commons-digester</artifactId>
                           <version>1.8</version>
                      </dependency>
            
                      <dependency>
                           <groupId>org.jboss.seam</groupId>
                           <artifactId>jboss-seam-debug</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-mail</artifactId>
                           <version>${seam-version}</version>
                      </dependency>
                      <dependency>
                           <groupId>org.jboss.seam</groupId>
                           <artifactId>jboss-seam-pdf</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.jboss.seam</groupId>
                           <artifactId>jboss-seam-ui</artifactId>
                           <version>${seam-version}</version>
                      </dependency>
            
            
                      <dependency>
                           <groupId>com.sun.facelets</groupId>
                           <artifactId>jsf-facelets</artifactId>
                           <version>1.1.14</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>
            
                      <dependency>
                           <groupId>javax.persistence</groupId>
                           <artifactId>persistence-api</artifactId>
                      </dependency>
                      <dependency>
                           <groupId>javax.ejb</groupId>
                           <artifactId>ejb-api</artifactId>
                           <version>3.0</version>
                      </dependency>
                      <dependency>
                           <groupId>org.hibernate</groupId>
                           <artifactId>hibernate-annotations</artifactId>
                           <version>3.3.1.GA</version>
                      </dependency>
                      <dependency>
                           <groupId>org.hibernate</groupId>
                           <artifactId>hibernate-validator</artifactId>
                           <version>3.1.0.CR1</version>
                      </dependency>
                      <dependency>
                           <groupId>org.jboss.seam</groupId>
                           <artifactId>jboss-seam</artifactId>
                           <version>${seam-version}</version>
                      </dependency>
                 </dependencies>
            
                 <properties>
                      <seam-version>2.0.1.GA</seam-version>
                      <rich-faces-version>3.1.3.GA</rich-faces-version>
                 </properties>
            </project>
            

            • 3. Re: Info - Creating Seam project in Maven 2
              norad2

              ProjectName-war's pom.xml


              <?xml version="1.0" encoding="UTF-8"?>
              <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                   <modelVersion>4.0.0</modelVersion>
                   <groupId>com.company.component.projectName</groupId>
                   <artifactId>projectName</artifactId>
                   <version>1.0.0-1-SNAPSHOT</version>
                   <name>${project.version} ${artifactId}</name>
                   <description>A web interface for ...</description>
                   <parent>
                        <groupId>com.company.component</groupId>
                        <artifactId>projectName</artifactId>
                        <version>1.0.0-1-SNAPSHOT</version>
                   </parent>
                   <packaging>war</packaging>
                   <repositories>
                        <repository>
                             <name>JBoss</name>
                             <releases>
                                  <enabled>true</enabled>
                             </releases>
                             <id>jboss</id>
                             <url>http://repository.jboss.com/maven2</url>
                        </repository>     
                   </repositories>
                   <build>
                        <plugins>
                             <plugin>
                                  <groupId>org.apache.maven.plugins</groupId>
                                  <artifactId>maven-war-plugin</artifactId>
                                  <version>2.0.2</version>
                                  <configuration>
                                       <warName>${artifactId}</warName>
                                  </configuration>
                                  <executions>
                                       <execution>
                                            <id>make-war</id>
                                            <phase>install</phase>
                                            <goals>
                                                 <goal>war</goal>                                   
                                            </goals>
                                       </execution>
                                  </executions>
                             </plugin>
                        </plugins>
                   </build>
                   
                   <dependencies>
                        <dependency>
                             <groupId>commons-beanutils</groupId>
                             <artifactId>commons-beanutils</artifactId>
                             <version>1.6</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>commons-logging</groupId>
                                       <artifactId>commons-logging</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-collections</groupId>
                                       <artifactId>commons-collections</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>commons-digester</groupId>
                             <artifactId>commons-digester</artifactId>
                             <version>1.8</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>commons-beanutils</groupId> 
                                       <artifactId>commons-beanutils</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-logging</groupId> 
                                       <artifactId>commons-logging</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-debug</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>com.sun.facelets</groupId> 
                                       <artifactId>jsf-facelets</artifactId>  
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-ioc</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>jboss</groupId> 
                                       <artifactId>javassist</artifactId> 
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-mail</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam-ui</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>com.sun.facelets</groupId> 
                                       <artifactId>jsf-facelets</artifactId> 
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-pdf</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>com.lowagie</groupId> 
                                       <artifactId>itext</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam-ui</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>com.sun.facelets</groupId> 
                                       <artifactId>jsf-facelets</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-remoting</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>dom4j</groupId> 
                                       <artifactId>dom4j</artifactId> 
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        <dependency>
                             <groupId>org.jboss.seam</groupId>
                             <artifactId>jboss-seam-ui</artifactId>
                             <version>${seam-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>org.jboss.seam</groupId> 
                                       <artifactId>jboss-seam</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-beanutils</groupId> 
                                       <artifactId>commons-beanutils</artifactId> 
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        
              
                        <dependency>
                             <groupId>com.sun.facelets</groupId>
                             <artifactId>jsf-facelets</artifactId>
                             <version>1.1.14</version>
                        </dependency>
              
                        <dependency>
                             <groupId>org.richfaces.framework</groupId>
                             <artifactId>richfaces-impl</artifactId>
                             <version>${rich-faces-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>javax.faces</groupId>
                                       <artifactId>jsf-api</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>javax.faces</groupId>
                                       <artifactId>jsf-impl</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>javax.servlet</groupId>
                                       <artifactId>jstl</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-logging</groupId>
                                       <artifactId>commons-logging</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-beanutils</groupId>
                                       <artifactId>commons-beanutils</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-digester</groupId>
                                       <artifactId>commons-digester</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-collections</groupId>
                                       <artifactId>commons-collections</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>org.richfaces.framework</groupId>
                                       <artifactId>richfaces-api</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        
                        <dependency>
                             <groupId>org.richfaces.ui</groupId>
                             <artifactId>richfaces-ui</artifactId>
                             <version>${rich-faces-version}</version>
                             <exclusions>
                                  <exclusion>
                                       <groupId>javax.faces</groupId>
                                       <artifactId>jsf-api</artifactId> 
                                  </exclusion>
                                  <exclusion>
                                       <groupId>javax.faces</groupId>
                                       <artifactId>jsf-impl</artifactId>
                                  </exclusion>
                                  <exclusion>
                                       <groupId>commons-collections</groupId>
                                       <artifactId>commons-collections</artifactId>
                                  </exclusion>
                             </exclusions>
                        </dependency>
                        
                   </dependencies>
                   
                   <properties>
                        <seam-version>2.0.1.GA</seam-version>
                        <rich-faces-version>3.1.3.GA</rich-faces-version>
                   </properties>
              </project>
              



              You will notice alot of exclusions. While many of them may not be necessary, many of them are. JBoss has its own set of Jars that will be used at runtime. If you do not exclude them, when the project runs the jars in the project will be used instead of the JBoss versions. This can lead to the jars conflicting due to incorrect versions.

              • 4. Re: Info - Creating Seam project in Maven 2
                joshc1107

                Could you also just specify the dependencies with a provided scope (<scope>provided</scope>) so that they won't conflict that the JBoss .jars at runtime?

                • 5. Re: Info - Creating Seam project in Maven 2
                  gebuh

                  I'm a bit confused by this.  I thought maven was a build tool, how do the exclusions and dependencies get managed after deployment?  If I build with maven will the resultant artifact be structured differently than if I built with ant?