Skip to content

Build It

Arvind Krishnakumar edited this page Sep 23, 2021 · 9 revisions

Snapshot Builds

If you want to consume SNAPSHOT versions of the Okta Java SDK, you can pick them on oss.sonatype.org. Take a look at the Sonatype OSSRH usage guide.

If you want to build or contribute, keep reading.

Local Builds

If you want to build locally, simply clone the project and run mvn install (just like any other Maven based project).

A few things to note:

  • We use OpenAPI to generate the source classes. @okta/openapi would be installed from npm during the build. Therefore, you have to install Node.js & NPM on your machine to build the project.
  • The default build will also include running Integration Tests that require a connection to a live server
    • You can skip the ITs by adding -DskipITs the command line.
    • To run the ITs you can simply configure the build with an ~/.okta/okta.yaml file, environment variables, or Java system properties. See Client properties references.
  • Before submitting a Pull Request it is recommended you run a mvn clean install -Pci build. This include a Findbugs/Findbugs Sec, PMD checks, and license header checks.

Running the ITs

In order to run the ITs against your Okta Organization, you need to setup enable Factor support and add a hand full of custom properties to the default User profile.

Factors

Log into your Okta admin console select: Security -> Multifactor -> Factor Types. Enable all of the factors that do NOT have a Configure button. After saving your factor list should look like this:

Custom User Profile

While in your Okta admin console select: Directory -> Profile Editor, select Okta from the left nav, then click the Profile button. Add the following properties:

  • customNumber
  • customBoolean
  • customInteger
  • customStringArray
  • customNumberArray
  • customIntegerArray

CI Builds

This project uses Travis-CI, which means the CI builds are defined in the .travis.yml.

There are four types of builds CI builds

  1. Nightly CRON Job Simply runs a OWASP dependency check NOTE: Due to the nature of this scan, false positives are detected, so a failing build may just require an suppression setting in src/owasp-suppression.xml

  2. Pull Request from outside this repository ITs will be skipped as Travis secrets are NOT included for branches outside of this repository

  3. Pull Requests from within this repository ITs will be run, this is equivalent to running a -Pci build mentioned above

  4. Master builds Once a PR or other push happens to master, javadocs are published to: https://developer.okta.com/okta-sdk-java/development/apidocs/

CI Environment Variables

NOTE these environment variables are ONLY available for pull requests made from with this repository

  • OKTA_CLIENT_ORGURL - The Org URL of the Okta tenant used for ITs
  • OKTA_CLIENT_TOKEN - The API token associated with the Okta tenant used for ITs
  • OKTA_CLIENT_CONNECTIONTIMEOUT - The SDK client timeout in seconds.
  • OKTA_IT_OPERATION_DELAY - The delay between ITs API operations (to avoid backend API flakiness)

Misc

For information on how to perform a release, see the Release Guide.