Added by Jasha Joachimsthal, last edited by Ard Schrijvers on Jul 16, 2007  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

This page describes what needs to be configured for a website using Hippo Cocoon and maven.

  1. Create a folder persistence with the following files from the Hippo Community apps
    • persistence.properties
    • persistenceApplicationContext.xml, comment the import elements at the bottom you don't need
  2. Copy the variables in project.properties from the Hippo Community Apps to your build.properties
  3. Fill in the values in build.properties
  4. Set the following values to false. These should be managed from Hippo CMS.
    hca.jpox.autocreatetables=false
    hca.jpox.autocreateschema=false
    hca.jpox.autocreatecolumns=false
    hca.jpox.autocreateconstraints=false
  5. Copy maven.xml to the root folder of your project, at the level of project.properties or build.properties
  6. Change the file attribute to the path in your site project. This path occurs twice.
    <ant:copy file="CHANGE THIS" todir="DO NOT CHANGE"/>
  7. Add the following dependencies to project.xml:
    <dependency>
            <groupId>hippo</groupId>
            <artifactId>hippo-community-apps</artifactId>
            <version>1.01.00</version>
            <type>jar</type>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          <!-- JDO/JPOX dependencies -->
          <dependency>
            <groupId>jpox</groupId>
            <artifactId>maven-jpox-plugin</artifactId>
            <version>1.1.7</version>
            <type>plugin</type>
          </dependency>
          
          <dependency>
            <groupId>jpox</groupId>
            <artifactId>jpox</artifactId>
            <version>1.1.7</version>
            <properties>
              <classloader>root</classloader>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          
          <dependency>
            <groupId>jpox</groupId>
            <artifactId>jpox-enhancer</artifactId>
            <version>1.1.7</version>
          </dependency>
          
          <dependency>
            <groupId>jpox</groupId>
            <artifactId>jpox-springframework</artifactId>
            <version>1.1.3</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          
          <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo2-api</artifactId>
            <version>2.0</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          <dependency>
            <groupId>jta</groupId>
            <artifactId>jta</artifactId>
            <version>1.0.1</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          
          <!-- Spring dependencies -->
          <dependency>
            <id>org.springframework:spring</id>
            <version>2.0</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          <dependency>
            <id>org.springframework:spring-mock</id>
            <version>2.0</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          <dependency>
            <id>org.springframework:spring-dao</id>
            <version>2.0</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
          <dependency>
            <id>org.springframework:spring-jdo</id>
            <version>2.0</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
  8. Add a dependency for your local database, e.g.
    <dependency>
            <artifactId>mysql-connector</artifactId> 
            <groupId>mysql</groupId>
            <version>3.1.13</version>
            <properties>
              <cocoon.bundle>true</cocoon.bundle>
            </properties>
          </dependency>
  9. Add a file sprint-context-listener.xweb in src/config
    <xweb xpath="/web-app" 
      unless="comment()[contains(., 'Spring context loader listener')]" 
      insert-before="servlet">
       
      <!-- Spring context loader listener -->
       <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
       </listener>
       
    </xweb>
  10. Add a file spring-context-param.xweb to src/config
    <xweb xpath="/web-app" 
      unless="comment()[contains(., 'Location of the Spring application context configuration file')]" 
      insert-before="filter">
      
      <!-- Location of the Spring application context configuration file -->
       <context-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>
           classpath:persistenceApplicationContext.xml
         </param-value>
       </context-param>
       
    </xweb>
  11. Build with Maven 1 and run.