# Adding new libraries to use in groovy script connector

**URL:** <https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143>\
**Category:** Identity Life Cycle Management\
**Created:** [May 29, 2025, 1:00pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143 "2025-05-29T13:00:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccaballero646](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ccaballero646/32/23_2.png) [@ccaballero646](https://community.openiam.com/u/ccaballero646)\
**Post date:** [May 29, 2025, 1:00pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/1 "2025-05-29T13:00:50Z")

</div>

Hi,  
I’m implementing a managed system using the Groovy script connector, and I’d like to know if it’s possible to add custom JAR libraries for use within the scripts. My specific use case is that I already have libraries that handle the mapping of requests and responses for that particular system’s API.  
I’ve already found the documentation on how to allow packages inside OpenIAM.

Thanks!  
Cristhian

---

<div class="post-metadata">

**Author:** ![ameet\_shah](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ameet_shah/32/17_2.png) [@ameet\_shah](https://community.openiam.com/u/ameet_shah)\
**Post date:** [June 3, 2025, 4:44pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/2 "2025-06-03T16:44:32Z")

</div>

Hello Cristhian,

To use custom JAR libraries within the Groovy script connector, you’ll need to whitelist the required packages. You can refer to the documentation below for guidance on how to do this:

[Whitelisting Packages – OpenIAM Documentation](https://docs.openiam.com/docs-4.2.1.13/developerguide/3-whitelisting)

In the case of the Groovy script connector, you will also need to modify the `start.sh` file used to launch the connector JAR by including the necessary libraries. Once you’ve updated the `start.sh` file with your libraries, restart the connector using the modified script to apply the changes.

Thanks,  
Ameet

---

<div class="post-metadata">

**Author:** ![ccaballero646](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ccaballero646/32/23_2.png) [@ccaballero646](https://community.openiam.com/u/ccaballero646)\
**Post date:** [June 3, 2025, 6:20pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/3 "2025-06-03T18:20:42Z")

</div>

Hello Ameet!  
Regarding the modification of the `start.sh` file to include the JAR files, the -cp flag of Java should be used?  
Thanks!  
Cristhian

---

<div class="post-metadata">

**Author:** ![ameet\_shah](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ameet_shah/32/17_2.png) [@ameet\_shah](https://community.openiam.com/u/ameet_shah)\
**Post date:** [June 4, 2025, 9:58pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/4 "2025-06-04T21:58:51Z")

</div>

Hello Cristhian,

In this case, there’s no need to use the `-cp` flag. Instead, we’re specifying the required package access using the `-D` system property, like so:

```auto
Dorg.openiam.groovy.extra.whitelist.package=com.ibm.db2.cmx.internal.json4j,java.io,java.sql,org.apache.commons.io

```

 ![scriptReply](https://canada1.discourse-cdn.com/flex010/uploads/openiam_community/original/1X/cb407be19bd8c1eef5e2558ff988a0c275705a30.png)

This ensures the necessary packages are available for Groovy scripting without modifying the classpath.

I’ve also added a sample `start.sh` file for your reference — feel free to use or adapt it as needed.

Thanks,  
Ameet

[start.sh](https://community.openiam.com/uploads/short-url/8FFfcAEWNyU6AeQC0wxSJi8HdCF.sh) (562 Bytes)

---

<div class="post-metadata">

**Author:** ![ccaballero646](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ccaballero646/32/23_2.png) [@ccaballero646](https://community.openiam.com/u/ccaballero646)\
**Post date:** [June 5, 2025, 1:03pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/5 "2025-06-05T13:03:34Z")

</div>

Hi Ameet,  
Thanks for the example!  
Regarding the JAR files that contain the packages I want to allow — where should those be located?  
Thanks again!

---

<div class="post-metadata">

**Author:** ![ameet\_shah](https://yyz2.discourse-cdn.com/flex010/user_avatar/community.openiam.com/ameet_shah/32/17_2.png) [@ameet\_shah](https://community.openiam.com/u/ameet_shah)\
**Post date:** [June 6, 2025, 3:58pm UTC](https://community.openiam.com/t/adding-new-libraries-to-use-in-groovy-script-connector/143/6 "2025-06-06T15:58:48Z")

</div>

Hello Cristhian,

The JAR files that contain the packages you want to allow should be placed in a location that is accessible to the application’s runtime environment — typically, this means adding them to the classpath or placing them in a designated `lib` directory.
