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
- Eclipse
- Local Maven Repository (e.g. C:\mvnrepository)
- M2_REPO
- M2_OPTS
- Rice Foundation Codebase
- JDK
Development Environment
Build Sheet
Create Maven Project
- At a command prompt, navigate to your <workspace> (e.g. C:\Development\KualiRice.workspace)
- 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
This creates a directory named ucd-kim-impl (after the artifactId) in your <workspace>
- Navigate to the ucd-kim-impl subdirectory and generate the Eclipse project
<workspace>\ucd-kim-impl> mvn eclipse:eclipse
Import into Eclipse
- Go to File -> Import -> Existing projects into Workspace
- Select <workspace>\ucd-kim-impl as the root directory and click Finish
Configure POM
- Define base properties:
groupId
edu.ucdavis.iet.kuali.rice
artifactId
ucd-kim-impl
packaging
jar
version
1.0.0
name
ucd-kim-impl
- Add dependency properties:
spring.version
2.0.4
spring-ldap.version
1.3.0.RELEASE
commons-lang.version
2.3
rice-api.version
0.9.4-SNAPSHOT
rice-impl.version
0.9.4-SNAPSHOT
db-ojb.version
1.0.4-patch2
servlet-api.version
2.4
iet-ldap-widget.version
1.0.0
- Add dependencies:
- Spring LDAP Core
- Spring
- Rice API
- Rice Implementation
- Common Lang
- DB OJB
- Servlet API
- IET LDAP Widget
- Add repository for Spring LDAP Core
Configure Dependencies on the Build Path
Method A:
- In the Java Build Path dialog box, click on the Libraries tab
- Click Add Variable
- Select M2_REPO and click OK
- Select the variable you just added and click Edit, then Extenstion
- 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)
- Repeat for all other dependencies
If the JAR you want is not already in your local Maven repository, you must install it using mvn:install
For example, to install Rice API and Rice Implementation:mvn install:install-file -DgroupId=org.kuali.rice -DartifactId=rice-api -Dversion=0.9.4-SNAPSHOT -Dpackaging=jar -Dfile=<workspace>rice-0.9.4\api\target\rice-api-0.9.4-SNAPSHOT.jar
mvn install:install-file -DgroupId=org.kuali.rice -DartifactId=rice-api -Dversion=0.9.4-SNAPSHOT -Dpackaging=jar -Dfile=<workspace>rice-0.9.4\impl\target\rice-impl-0.9.4-SNAPSHOT.jar
Method B:
- In the Java Build Path dialog box, click on the Libraries tab
- Click Add External JARs
- Select the appropriate JAR from your file system (e.g. C:\JavaLib\spring-framework-2.5.5\dist\spring.jar)
- Repeat for all other dependencies
- Method A works well if you want to perform the Maven builds yourself.
- Method B works well if you use a continuous integration system like Bamboo to perform the Maven builds.