8 Replies Latest reply: Feb 23, 2012 1:32 AM by Jaikrat Singh RSS

    Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)

    Abdulkerim İnanmış Novice

      Hello, I am trying to configure a project including maven jsf 2 and richfaces 4. Can you help me?

        • 2. Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
          Abdulkerim İnanmış Novice

          I tried the instructions in this page, but maven could not find jars related with richfaces 4 . 

          • 3. Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
            Nick Belaevski Master

            It should work - please post more details on error you get.

            • 4. Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
              Abdulkerim İnanmış Novice

              I am taking below error when adding richfaces depenencies.

               

              Project build error: Non-resolvable import POM: Failure to find org.richfaces:richfaces-bom:pom:4.0.0.20110227-CR1 in http://download.java.net/maven/2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced

               

              my pom.xml is below.

               

              <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.hascode.jsf</groupId>

                <artifactId>registration-demo</artifactId>

                <packaging>war</packaging>

                <version>1.0-SNAPSHOT</version>

                <name>registration-demo Maven Webapp</name>

                <url>http://maven.apache.org</url>

              <repositories>

              <repository>

                <id>maven2-repository.dev.java.net</id>

                <name>Java.net Repository for Maven</name>

                <url>http://download.java.net/maven/2</url>

              </repository>

              <repository>

                <id>JBoss repository</id>

                <url>http://repository.jboss.com/maven2/</url>

              </repository>

              </repositories>

               

               

              <properties>

                      <!-- for Alhpa versions it was just 'ALPHA2' --> 

                      <org.richfaces.bom.version>4.0.0.20110227-CR1</org.richfaces.bom.version>

                 

                  </properties>

               

               

                  <dependencyManagement>

                      <dependencies>

                          <dependency>

                              <groupId>org.richfaces</groupId>

                              <artifactId>richfaces-bom</artifactId>

                              <version>${org.richfaces.bom.version}</version>

                              <scope>import</scope>

                              <type>pom</type>

                          </dependency>

                        <dependency>

                                          <groupId>org.richfaces.ui</groupId>

                                          <artifactId>richfaces-components-ui</artifactId>

                                      </dependency>

                                      <dependency>

                                          <groupId>org.richfaces.core</groupId>

                                          <artifactId>richfaces-core-impl</artifactId>

                                     </dependency>

                                      <dependency>

                                       <groupId>org.richfaces.cdk</groupId>

                                       <artifactId>annotations</artifactId>

                                       <scope>provided</scope>

                                            </dependency>

                      </dependencies>

                  </dependencyManagement>

                 

                <dependencies>

                   <dependency>

                    <groupId>junit</groupId>

                    <artifactId>junit</artifactId>

                    <version>3.8.1</version>

                    <scope>test</scope>

                  </dependency>

                 

                 <dependency>

                      <groupId>com.sun.faces</groupId>

                      <artifactId>jsf-api</artifactId>

                      <version>2.0.2</version>

                      <scope>compile</scope>

                  </dependency>

                  <dependency>

                      <groupId>com.sun.faces</groupId>

                      <artifactId>jsf-impl</artifactId>

                      <version>2.0.2</version>

                      <scope>compile</scope>

                  </dependency>

                  <dependency>

                                            <groupId>jstl</groupId>

                                            <artifactId>jstl</artifactId>

                                            <version>1.2</version>

                                  </dependency>

                </dependencies>

                <build>

                  <finalName>registration-demo</finalName>

                  <plugins>

                        <plugin>

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

                                  <artifactId>maven-compiler-plugin</artifactId>

                                  <version>2.0.2</version>

                                  <configuration>

                                            <source>1.6</source>

                                            <target>1.6</target>

                                  </configuration>

                        </plugin>

              </plugins>

                </build>

              </project>

              • 5. Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
                Abdulkerim İnanmış Novice

                I solved my problem. my final pom file below. I added jboss repository and  richfaces version informations.

                 

                <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.hascode.jsf</groupId>

                  <artifactId>registration-demo</artifactId>

                  <packaging>war</packaging>

                  <version>1.0-SNAPSHOT</version>

                  <name>registration-demo Maven Webapp</name>

                  <url>http://maven.apache.org</url>

                <repositories>

                <repository>

                  <id>maven2-repository.dev.java.net</id>

                  <name>Java.net Repository for Maven</name>

                  <url>http://download.java.net/maven/2</url>

                </repository>

                <repository>

                  <id>JBoss repository</id>

                  <url>http://repository.jboss.com/maven2/</url>

                </repository>

                  <repository>

                      <id>jboss-public-repository-group</id>

                      <name>JBoss Public Repository Group</name>

                      <url>http://repository.jboss.org/nexus/content/groups/public/</url>

                      <layout>default</layout>

                      <releases>

                        <enabled>true</enabled>

                        <updatePolicy>never</updatePolicy>

                      </releases>

                      <snapshots>

                        <enabled>true</enabled>

                        <updatePolicy>never</updatePolicy>

                      </snapshots>

                    </repository>

                </repositories>

                  <pluginRepositories>

                    <pluginRepository>

                      <id>jboss-public-repository-group</id>

                      <name>JBoss Public Repository Group</name>

                      <url>http://repository.jboss.org/nexus/content/groups/public/</url>

                      <releases>

                        <enabled>true</enabled>

                      </releases>

                      <snapshots>

                        <enabled>true</enabled>

                      </snapshots>

                    </pluginRepository>

                  </pluginRepositories>

                <properties>

                        <!-- for Alhpa versions it was just 'ALPHA2' --> 

                        <org.richfaces.bom.version>4.0.0.20110227-CR1</org.richfaces.bom.version>

                   

                    </properties>

                 

                 

                    <dependencyManagement>

                        <dependencies>

                            <dependency>

                                <groupId>org.richfaces</groupId>

                                <artifactId>richfaces-bom</artifactId>

                                <version>${org.richfaces.bom.version}</version>

                                <scope>import</scope>

                                <type>pom</type>

                            </dependency>

                          <dependency>

                                            <groupId>org.richfaces.ui</groupId>

                                            <artifactId>richfaces-components-ui</artifactId>

                                            <version>${org.richfaces.bom.version}</version>

                                        </dependency>

                                        <dependency>

                                            <groupId>org.richfaces.core</groupId>

                                            <artifactId>richfaces-core-impl</artifactId>

                                            <version>${org.richfaces.bom.version}</version>

                                       </dependency>

                                        <dependency>

                                         <groupId>org.richfaces.cdk</groupId>

                                         <artifactId>annotations</artifactId>

                                         <version>${org.richfaces.bom.version}</version>

                                         <scope>provided</scope>

                                              </dependency>

                        </dependencies>

                    </dependencyManagement>

                   

                  <dependencies>

                     <dependency>

                      <groupId>junit</groupId>

                      <artifactId>junit</artifactId>

                      <version>3.8.1</version>

                      <scope>test</scope>

                    </dependency>

                   

                   <dependency>

                        <groupId>com.sun.faces</groupId>

                        <artifactId>jsf-api</artifactId>

                        <version>2.0.2</version>

                        <scope>compile</scope>

                    </dependency>

                    <dependency>

                        <groupId>com.sun.faces</groupId>

                        <artifactId>jsf-impl</artifactId>

                        <version>2.0.2</version>

                        <scope>compile</scope>

                    </dependency>

                    <dependency>

                                              <groupId>jstl</groupId>

                                              <artifactId>jstl</artifactId>

                                              <version>1.2</version>

                                    </dependency>

                  </dependencies>

                  <build>

                    <finalName>registration-demo</finalName>

                    <plugins>

                          <plugin>

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

                                    <artifactId>maven-compiler-plugin</artifactId>

                                    <version>2.0.2</version>

                                    <configuration>

                                              <source>1.6</source>

                                              <target>1.6</target>

                                    </configuration>

                          </plugin>

                          <plugin>

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

                                <artifactId>maven-war-plugin</artifactId>

                                <version>2.1-beta-1</version>

                                <configuration>

                                    <failOnMissingWebXml>false</failOnMissingWebXml>

                                </configuration>

                            </plugin>

                </plugins>

                  </build>

                </project>

                • 6. Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
                  Ilya Shaikovsky Master

                  page to which Nick pointed you already contains the link to http://community.jboss.org/wiki/MavenGettingStarted-Users article which explains common settings for maven while working with Jboss projects.

                  • 7. Re: Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
                    Mital Pritmani Newbie

                    Hi,

                     

                    Thanks for your post. It helped me in solving my problem.

                     

                    Actually I was not able to get the jars of richfaces but after adding jboss repository, my problem got solved.

                     

                    But I have one doubt. When I add the richfaces-ui and richfaces-core dependency in dependencymanagement section, it does not download richfaces jars and so don't show richfaces and a4j tags. And if I move those both tags out of dependencymanagement tag, and write in other dependencies tag, both jars get downloaded and I am able to use its components. Can you please tell me why is it happening?

                    • 8. Re: Hi,how can I configure maven,jsf2.0,richfaces 4 ? (pom.xm,web.xml,face-config.xml vb)
                      Jaikrat Singh Newbie

                      Hey, I am also facing somewhat same problem. After putting the jboss entries in my setting.xml, I am getting some authentication issue while running the command "mvn install".

                       

                      Error:-

                       

                      Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repository.jboss.com/maven2/org/richfaces/ui/richfaces-components-ui/4.0

                      .0/richfaces-components-ui-4.0.0.pom, ReasonPhrase:Forbidden.

                       

                      I also put four below entries in my pom.xml

                       

                      <dependency>
                      <groupId>org.richfaces.ui</groupId>
                      <artifactId>richfaces-components-ui</artifactId>
                      <version>4.0.0</version>
                      </dependency>
                      <dependency>
                      <groupId>org.richfaces.core</groupId>
                      <artifactId>richfaces-core-impl</artifactId>
                      <version>4.0.0</version>
                      </dependency>
                      <dependency>
                      <groupId>org.richfaces.ui</groupId>
                      <artifactId>richfaces-components-api</artifactId>
                      <version>4.0.0</version>
                      </dependency>
                      <dependency>
                      <groupId>org.richfaces.core</groupId>
                      <artifactId>richfaces-core-api</artifactId>
                      <version>4.0.0</version>
                      </dependency>

                       

                      Any thought.

                       

                      Thanks

                      Jaikrat Singh