yoav.str
yoav.str

Reputation: 1534

How to start a Maven Spring JSF 2.0 Richfaces project?

For some of you it might sound trvial, but for days I have been fighting with pom.xml files and facets in order to build a Spring JSF 2.0 Maven project (run on tomcat 7.0) with RichFaces, but with no success. Can someone please reference me to a full working example ,I am using STS (tutorial from scratch , I can download a fully working example but I want to learn how to create one ) ?

Upvotes: 2

Views: 6344

Answers (1)

yoav.str
yoav.str

Reputation: 1534

So after few days of work I came to the conclusion I have to do the dirty work therefore I will explain how I managed to start a project :

  1. download sts
  2. open template project , in my case it was spring integration with hibernate
  3. right click on project-> preferences->facets
  4. change to JSF 2.0 and web dynamic above 2.5(require above 1.5 java )
  5. add to the maven dependencies ( pom.xml ):

      <!-- spring hibernate 3 -->
    
    <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-hibernate3</artifactId>
         <version>2.0.8</version>
    </dependency>
    
  6. set up your

      <property name="dataSource" ref="dataSource" />
    

the ref is pointed to this bean :

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:hsqldb:mem:."/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>

or any other you decide ...

  1. add to your project pom :

    <dependency>
      <groupId>org.richfaces.framework</groupId>
      <artifactId>richfaces-impl</artifactId>
      <version>3.2.2.GA</version>
    </dependency>
    
    <dependency>           
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>3.2.2.GA</version>
    </dependency>
    
    1. start praying it will work :)

Upvotes: 1

Related Questions