You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

How To Setup a Grouper Development Environment

This how-to describes how to set up a Grouper development environment so that you can run, test, and debug the Grouper project.

The example commands and screenshots are from MacOS and may vary slightly for different environments. However, the overall process should be similar on any modern operating system and development tool chain.

Prerequisites

Git for source code version control

  1. Install Git

    1. $ brew install git

    2. https://github.com/fabriziocucci/git-bash-for-mac

    3. Or Install from package https://git-scm.com/downloads

  2. Github Desktop is also handy

Java - Grouper runs on Java

  1. Install OpenJDK 8 or above. Grouper runs on Java.

    1. https://aws.amazon.com/corretto/

Apache Tomcat - Grouper runs in Tomcat

  1. Download and unpack Tomcat 8.5.x
    1. https://tomcat.apache.org/download-80.cgi

Docker Desktop

  1. Install Docker Desktop. We’ll use this to run our development database.
    1. https://www.docker.com/products/docker-desktop

Eclipse - Grouper development happens in Eclipse

  1. Install Eclipse IDE for Enterprise Java Developers or similar IDE
    1. https://www.eclipse.org/downloads/packages/

Clone the Grouper Source Repository

The Grouper code repository is available on https://github.com/Internet2/grouper

  1. git clone --depth 1 https://github.com/Internet2/grouper.git grouper-2.5

It is recommend not to switch between 2.4 and 2.5 branches in the same directory and workspace when developing since it makes keeping development environment straight difficult. Instead keep 2.4 and 2.5 work in separate local repos each with their own eclipse workspace.

To developer on 2.4

  1. git clone --depth 1 https://github.com/Internet2/grouper.git grouper-2.4
  2. git checkout GROUPER_2_4_BRANCH

Import Projects into Eclipse

Start a new eclipse workspace and import grouper modules as individual projects. Project will import as Maven projects and automatically download the required Maven dependencies. The example commands below assume the git repository was cloned to the local directory '/Users/thompsow/src/grouper-2.5/'.

  1. Import grouperClient
    1. Eclipse -> File -> Open Projects for File System or Archive
    2. Import source: /Users/thompsow/src/grouper-2.5/grouper-misc/grouperClient
  2. Import the grouper
    1. Eclipse -> File -> Open Projects for File System or Archive
    2. Import source: /Users/thompsow/src/grouper-2.5/grouper
  3. Import grouper-ui
    1. Eclipse -> File -> Open Projects for File System or Archive
    2. Import source: /Users/thompsow/src/grouper/grouper-ui
  4. Import grouper-ws
    1. Eclipse -> File -> Open Projects for File System or Archive
    2. Import source: /Users/thompsow/src/grouper/grouper-ws/grouper-ws

All the project should now be open and compiled.

Link source and conf to grouper-ui project

We want to be able to run and debug the Grouper UI from the grouper-ui/webapp folder, so that we can work on webapp artifacts (JSPs, etc), and at the same time update Java code in the grouper project and other code locations. To do this we will update the Java Build Path output folder so that compiled classes and other artifacts go to the right directories under grouper-ui/webapp. We will also add some dependent source and library folders to the grouper-ui Java Build Path.

  1. grouper-ui -> File -> Properties -> Java Build Path -> Source tab
    1. Set ‘Default output folder:’ to: grouper-ui/webapp/WEB-INF/classes (you may have to create this directory)
  2. Add dependent source and configuration folders to the Java Build Path
    1. Grouper Configuration
      1. Click ‘Link Source…’
      2. Click ‘Variables…’
      3. Click ‘New…’
        1. Name: GROUPER_REPO
        2. Click ‘Folder…’ and select the root repo folder
      4. Select GROUPER_REPO
      5. Click ‘Extend…’
      6. Select ‘grouper/conf’
      7. Folder name: grouper-conf
    2. Grouper source
      1. Click ‘Link Source…’
      2. Click ‘Variables…’
      3. Select GROUPER_REPO
      4. Click ‘Extend…’
      5. Select ‘grouper/src/grouper’
      6. Folder name: grouper-src
    3. GrouperClient source
      1. Click ‘Link Source…’
      2. Click ‘Variables…’
      3. Select GROUPER_REPO
      4. Click ‘Extend…’
      5. Select ‘grouper-misc/grouperClient/src/java
      6. Folder name: grouperClient-src
    4. GrouperClient configuration
      1. Click ‘Link Source…’
      2. Click ‘Variables…’
      3. Select GROUPER_REPO
      4. Click ‘Extend…’
      5. Select ‘grouper-misc/grouperClient/conf’
      6. Folder name: grouperClient-conf
  3. Make sure all folders except ‘grouper-ui/java/test’ are using the default output folder
  4. Make sure grouper-ui/conf has ‘Excluded:’ set to (None)
  5. Remove srcPoc and misc source folders (these are not needed)

The grouper-ui Java Build Path should now look something like this:

Add runtime jars to grouper-ui Java Build Path

We need to pull dependent jar files into grouper-ui/webapp/WEB-INF/lib directory. We’ll do this by adding three more “source” folders to the grouper-ui Java Build Path.

  1. grouper-ui -> File -> Properties -> Java Build Path
    1. Add grouper jars
      1. Link Source…
        1. Linked folder location: GROUPER_REPO/grouper/lib/grouper
        2. Folder name: grouper-lib
  • No labels