Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set up your environment

Create a local project with the OpenIAM libraries on the classpath, in VS Code or Eclipse, so scripts compile before you deploy them.

Applies to: OpenIAM 2026.8.1

OpenIAM's customization points are Groovy scripts. They run inside the platform's JVM, against the platform's classes, inside its Spring context — which is why a script that looks correct in a text editor can fail to compile the moment it is saved.

This page sets up a local project with the OpenIAM libraries on the classpath, so your IDE resolves the classes you extend, completes their methods, and tells you about a mistake before the platform does.

What this builds, and how long it takes

You get

A Maven project that compiles OpenIAM Groovy scripts locally, with completion and error checking in your IDE

Time

20 minutes

You need

A workstation, and the repository details from your OpenIAM account team

Reversible

Yes — nothing here touches a deployment

You do not have to work this way. Scripts can be written directly in the Groovy Manager in the Webconsole, which compiles on save. For a one-line change that is faster. For anything you intend to keep, source control and a compiler on your desk are worth the twenty minutes.

Before you start

Version
Why this one

JDK

21

The platform compiles and runs on 21. A script compiled against an earlier JDK may still load, but you lose the guarantee that what compiles locally compiles on the server

Groovy

5.0.4

The version the platform embeds. Language features added after it will not compile on the server

Maven

3.9 or later

Any recent version

An IDE

VS Code or Eclipse

Both are covered below

Confirm the JDK before anything else, because getting it wrong produces errors that look like missing classes:

java -version
mvn -version

Expected: Java 21 from both, and Maven reporting the same JDK it will compile with.

Set these first

Scripts are compiled against a release. The classes change between releases, so a project built for one is not automatically right for another.


Build it

1. Add the OpenIAM repository

The classes your scripts extend ship as Maven artifacts. Add the repository to ~/.m2/settings.xml:

The repository is read-only and needs no credentials.

2. Create the project

Replace the generated pom.xml:

provided is deliberate. The platform supplies these at runtime. You compile against them; you never package them.

3. Mirror the server's folders

Do not add a package declaration. Of the scripts shipped under conf/iamscripts/, the large majority declare no package at all, and those that do use no single convention. The platform identifies a script by its name and its folder.

The class name must match the file name before the version suffix: MemberOf_1.0.groovy declares class MemberOf.

4. Set up VS Code

  1. Install the Extension Pack for Java and a Groovy language extension.

  2. Open the project folder. VS Code detects the pom.xml and imports it.

  3. Ctrl+Shift+P → Java: Configure Java Runtime → Java 21.

Reload the window after changing pom.xml. VS Code's Java support caches the classpath and does not always notice.

5. Or set up Eclipse

  1. Install Eclipse IDE for Enterprise Java and Web Developers.

  2. Install Groovy Development Tools from the Eclipse Marketplace, and restart.

  3. File → Import → Maven → Existing Maven Projects, and select the project folder.

  4. Right-click the project → Configure → Convert to Groovy Project.

  5. Properties → Java Build Path → Libraries — JRE System Library on Java 21.

  6. Properties → Groovy Compiler — select the 5.x compiler level.

If the Groovy nature is missing, .groovy files are treated as plain text and nothing resolves. Step 4 is the one people skip.


Verify it

Create src/main/groovy/sync/HelloTransform.groovy:

Expected: BUILD SUCCESS.

Then open a shipped script from conf/iamscripts/provision/ in your IDE and confirm its imports resolve. If a real script from the platform resolves in your project, your environment is correct — a stronger check than compiling your own file, because the shipped scripts use more of the API.

If it goes wrong

What you see
What it means
What to do

Could not resolve dependencies for org.openiam:...

The repository is not configured, or the profile is not active

Check ~/.m2/settings.xml, and that openiam is in activeProfiles. mvn -X compile shows which repositories were tried

A specific version is not found

openiam.version does not match a published release

Set it to the release you are developing against

unable to resolve class in the IDE but mvn compile succeeds

Stale IDE classpath

VS Code: reload the window. Eclipse: Maven → Update Project

.groovy files have no highlighting or completion

Eclipse: the Groovy nature is not applied. VS Code: no Groovy extension

Eclipse: Configure → Convert to Groovy Project

Compiles locally, fails on save in the Groovy Manager

Local Groovy or JDK does not match the platform

Groovy 5.0.4, JDK 21

unable to resolve class for a class you can see in a jar

The dependency providing it is missing

Match the import to the artifact in step 2

A script compiles but an injected service is null at runtime

Injection resolves inside the platform's Spring context, not locally

This cannot be reproduced locally. Test on a deployment

What this procedure does not cover

Running or debugging a script outside the platform. Scripts depend on the platform's Spring context and its injected services, so they are exercised by deploying them — each tutorial shows how its type is triggered and where to look. Also not covered: the connector SDK, and building a connector.

Last updated

Was this helpful?