Building an Institutional Plugin using Maven

Building an Institutional Plugin using Maven

Overview

The purpose of this tutorial is to familiarize Kuali Rice developers with building institutional plugins that override out-of-the-box Rice services. This tutorial focuses on overriding the IdentityService as an example.

Prerequisites

  1. Download Rice Foundation Codebase into <workspace>\rice-0.9.4

  2. Configure Maven Repository

Development Environment

Build Sheet

Create Maven Project

  1. At a command prompt, navigate to your <workspace> (e.g. C:\Development\KualiRice.workspace)

  2. Create a web application project using the maven-archetype-quickstart archetype

    <workspace> mvn archetype:create -DgroupId=edu.ucdavis.iet.kuali.rice -DartifactId=ucd-kim-impl -DarchetypeArtifactId=maven-archetype-quickstart
  3. Navigate to the ucd-kim-impl subdirectory and generate the Eclipse project

    <workspace>\ucd-kim-impl> mvn eclipse:eclipse

Import into Eclipse

  1. Go to File -> Import -> Existing projects into Workspace

  2. Select <workspace>\ucd-kim-impl as the root directory and click Finish

Configure POM

  1. Define base properties:

  2. Add dependency properties:

  3. Add dependencies:

    • Spring LDAP Core

    • Spring

    • Rice API

    • Rice Implementation

    • Common Lang

    • DB OJB

    • Servlet API

    • Xalan-J

    • IET LDAP Widget

  4. Add repository for Spring LDAP Core

Declare Spring Beans

Configure Dependencies on the Build Path

Method A:
  1. In the Java Build Path dialog box, click on the Libraries tab

  2. Click Add Variable

  3. Select M2_REPO and click OK

  4. Select the variable you just added and click Edit, then Extenstion

  5. Select the appropriate JAR from the Maven repository hierarchy (e.g. spring-2.5.5.jar will be in org/spring/framework/spring/2.5.5)

  6. Repeat for all other dependencies

Method B:
  1. In the Java Build Path dialog box, click on the Libraries tab

  2. Click Add External JARs

  3. Select the appropriate JAR from your file system (e.g. C:\JavaLib\spring-framework-2.5.5\dist\spring.jar)

  4. Repeat for all other dependencies

Build the JAR

Method A:
  1. Compile the source code by selecting Project -> *Build Project (alternatively, configure Eclipse to always Build Automatically)

  2. At the command prompt, create a JAR from the compiled code

    <workspace>\ucd-kim-impl> mvn jar:jar

Deploy to local Maven Repository

Configure the Rice POM

Build the Rice WAR