I'm using NiFi 1.19 with Java 11. In ExecuteScript Groovy
import io.jsonwebtoken.*
String jwtToken = Jwts.builder()
gives me an exeption: groovy.lang.MissingPropertyException: No such property: Jwts for ...
I take a closer look at the jar files of the current version and older versions and found
NiFi 1.12
nifi-1.12.0\work\nar\framework\nifi-framework-nar-1.12.0.nar-unpacked\NAR-INF\bundled-dependencies
NiFi 1.19
nifi-1.19.0\work\nar\framework\nifi-framework-nar-1.19.0.nar-unpacked\NAR-INF\bundled-dependencies
CONCLUSION
So it seems that jjwt-x.y.z.jar is missing
The jjwt
JAR is a transitive dependency of the framework JAR(s), some of which are themselves dependencies (or transitive dependencies) of the nifi-scripting-nar
. This means you can't count on any of those transitive dependencies being available for use by ExecuteScript
, only those that are explicit dependencies in the nifi-scripting-nar
(and/or nifi-scripting-processors
) POM.
You can download it yourself and use the Module Directory
property to point at the JAR(s) or directories containing the JARs. If you're using Groovy you can also use @Grab
to dynamically download it and add it to the classpath, I have a blog post illustrating how to do that.