Access Keys:
Skip to content (Access Key - 0)
 

4. Advanced XWiki

Maven Runner

These are the steps needed to configure the Maven runner.
Before you begin, you must verify the following:

Maven Runner

Configuring a System Under Test can be tedious if you are having a lot of library dependencies. The Maven Runner allow you to use your existing pom.xml to resolve dependencies needed for the execution of specifications. Only the <dependencies> element of the pom.xml is read. Artifacts found will be resolved and added to the classpath of the runner. The artifact of the project itself will also be part of the classpath.

Maven Runner Configuration

  From the Runner Configuration Panel, please follow these steps.

  1. Click on Add a new Runner


  2. Enter the name of your Runner (Mandatory)
  3. Enter the Command line (please refer to Executing a Specification)
    Know that (similar to velocity)
    • ${classpaths} will be replaced by the Runner, SUT and Fixtures classpaths -(Mandatory for GP)
    • ${mainClass} will be replaced by the Runner specified Main Class -(Mandatory for GP)
    • ${inputPath} will be replaced by an input path -(Mandatory for GP)
    • ${outputPath} will be replaced by an output path -(Mandatory for GP)
    • ${locale} will be replaced by the user locale -Default: English (java only)
    • ${repository} will be replace by the repository of the Specification resolver class -Default: FileSystemRepository
    • ${fixtureFactory} will be replaced by the SUT Fixture Factory Class;Fixture Factory Args -Default: CoreFixtureFactory
    • ${projectDependencyDescriptor} will be replaced by the project dependency descriptor file location-(Mandatory for the Maven runner)
      Example of a command line:
      java -mx252m -cp ${classpaths} ${mainClass} ${inputPath} ${outputPath} -l ${locale} -r ${repository} -f ${fixtureFactory} --xml --pdd ${projectDependencyDescriptor}
  4. The main class : com.greenpepper.maven.runner.Main -(Mandatory, main Maven runner class)
  5. The Server name and port (if you are using the Remote agent)


  6. Click Save
  7. Enter the location of your Runner library and its dependencies.
    • GreenPepper Maven Runner library
      • greenpepper-maven-runner-x.x-complete.jar
    • Maven libraries
      • maven-2.x.x-uber.jar from the lib directory of your Maven home
      • classworlds-1.1.jar from the boot directory of your Maven home

System Under Test Configuration

Make sure your XWiki Space is registered as a GreenPepper Project (see)

From the Space Registration Panel, please follow these steps.

  1. Click on Add a new System Under Test
  2. Enter the name of your System Under Test (Mandatory)
  3. Select your Maven runner (Mandatory)
  4. Enter the Fixture factory to use (optional)
  5. Enter the Fixture arguments (optional)
  6. Enter the Project Dependency Descriptor (Mandatory)
    • Since we are using Maven, there is 2 possibilities :
      • use a valid Project Object Model file (pom.xml)
      • NEW in 2.8 use the groupId:artifactId:version (Maven Coordinates) where the version can be a Version Ranges
        Ex:
        greenpepper-open:greenpepper-core:2.7
        greenpepper-open:greenpepper-extensions-db:[2.7,)

        You may need to add required repositories to the settings.xml of Maven (or routing all repositories using the mirrors) using the coordinates.
  7. Click Save

Maven Plugin Fixture Artifact Dependency

By default, the Maven Runner will detect if the pom.xml is using the Maven Plugin to create fixture artifact. If so, the fixture artifact will be automatically added to the list of dependencies.

However, if you want to use a fixture artifact from another project, you will need to add the <dependency> of that project with <classifier>fixtures</classifier>.

Using an external database with XWiki

Web Container

Jetty

By default, the standalone XWiki distribution is using Jetty as the web container.

To use an external database for GreenPepper inside this distribution, you will need to :

  • Copy the JDBC driver to the directory WEB-INF/lib
  • Create a file WEB-INF/jetty-web.xml with the information about the database connectivity (JDBC). This example is defining a MySql database :
    WEB-INF/jetty-web.xml
    <?xml version="1.0"?>
    <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
    <Configure class="org.mortbay.jetty.webapp.WebAppContext">
        <New id="GreenPepperDS" class="org.mortbay.jetty.plus.naming.Resource">
            <Arg></Arg>
            <Arg>java:comp/env/jdbc/GreenPepperDS</Arg>
            <Arg>
                <New class="org.apache.commons.dbcp.BasicDataSource">
                    <Set name="driverClassName">com.mysql.jdbc.Driver</Set>
                    <Set name="url">jdbc:mysql://localhost:3306/greenpepper?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8</Set>
                    <Set name="username">[dbuser]</Set>
                    <Set name="password">[dbpassword]</Set>
                    <Set name="maxActive">5</Set>
                    <Set name="maxIdle">1</Set>
                    <Set name="maxWait">10000</Set>
                </New>
            </Arg>
        </New>
    </Configure>

Others

Follow the guide of your container to setup a JNDI datasource

Configuration

Go to the configuration screen of GreenPepper by clicking the icon or by browsing to *http://localhost:8080/xwiki/index.greenpepper* URL (make sure to point to your server host and port!).

Under the Database tab, you will need to use the Custom Installation type, select your database provider and enter the JNDI name of the datasource.

Make sure the Test link is successfull.

Adaptavist Theme Builder (3.1.4) Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007)
Free theme builder license