How do I add a Java library to Java transforms?

I want to import an Apache library from Maven to use it in a Java Transform.
When I open libraries menu in my repo I can find the desired library, but as opposed to Python transforms I cannot just “add” it.

What is the procedure to import the appropriate package to use it in a Java transform?

Hey there @Kuba , to add a java dependency, you must copy the gradle dependency string that’s shown to you after you use the libraries menu and select a library and paste it inside of the dependencies block in the transforms-java/build.gradle file. Note, to access this file, you must enable hidden files,

As an example, if I want to use Guava, I’d initially get this screen:

Thus, I’d copy the " implementation 'com.google.guava:guava:33.0.0-jre’" and paste it in the file:

1 Like