How To

How do I quickly test OpenIG 4.x configurations with Jetty?

Last updated Feb 11, 2020

The purpose of this article is to provide some hints around getting OpenIG up and running quickly using the Jetty® web container and the command line.


2 readers recommend this article

Archived

This article has been archived and is no longer maintained by ForgeRock.

Using jetty-runner

Prerequisites

  • Java® 7 or Java 8: An installation of Java that matches the supported version of OpenIG you want to run; see the release notes of the version you are working with.
  • jetty-runner: A copy of the jetty-runner.jar that matches the supported version of OpenIG you want to run; see the release notes of the version you are working with.
  • openig.war: A copy of the OpenIG war file that you want to use with jetty-runner. You can download the war file from BackStage.
  • OpenIG base configuration directory: An appropriate directory structure that holds the OpenIG configuration files.

Running

  • Enter the following command to start up the Jetty container to host OpenIG:
    $ java -Dopenig.base=[ig-configuration-directory] -jar [jetty-runner.jar] --path / [openig.war]
    replacing [ig-configuration-directory], [jetty-runner.jar] and [openig.war] with appropriate values.

Testing

  • Browse to the appropriate OpenIG URL to match the configuration used when starting up OpenIG.
Note

The default http listening port used by Jetty is 8080; use the jetty-runner --port parameter to change this as required, for example: --path / --port 7070 [openig.war]

Using the OpenIG source code and Maven

Caution

You must authenticate to the ForgeRock protected Maven repositories using your BackStage credentials in order to build OpenIG releases from source. See How do I access the ForgeRock protected Maven repositories? for further information. 

Prerequisites

  • Java 7 or Java 8: An installation of Java that matches the supported version of OpenIG you want to run; see the release notes of the version you are working with.
  • Apache Maven™ 3.x: An installation of at least Maven v3.3.9.
  • OpenIG source code: A clone of the OpenIG source code. See FAQ: Source code in OpenIG for further information on obtaining the source code.
  • OpenIG base configuration directory: An appropriate directory structure that holds the OpenIG configuration files.

Building

  • Change into the directory where you have cloned a copy of the OpenIG source code.
  • Checkout appropriate version of OpenIG, for example, if you want to run a copy of OpenIG 4.5:
    $ git checkout 4.5
  • Build the OpenIG project to generate the war file:
    $ mvn clean install

Running

  • Enter the following to start the Maven Jetty plugin from the source directory where you have successfully built a copy of the OpenIG version you want to run:
    $ mvn -pl openig-war jetty:run -Dopenig.base=[ig-configuration-directory]
    replacing [ig-configuration-directory] with an appropriate value.

Testing

  • Browse to the appropriate OpenIG URL to match the configuration used when starting up OpenIG.
Note

The default http listening port used by Jetty is 8080; use the java -Djetty.port parameter to change this as required, for example: jetty:run -Djetty.port=7070

See Also

Gateway Guide › The Configuration

jetty-runner documentation

jetty-runner downloads

Apache Maven downloads



Copyright and TrademarksCopyright © 2020 ForgeRock, all rights reserved.
Loading...