I'd like to provide an update on this, but the issue is not fully resolved.
I found a jar in [maven repo](https://mvnrepository.com/artifact/org.apache.nifi/nifi-lookup-service-api/1.13.0) which has the `LookupService`
This together with [org.apache.nifi.serialization.record.Record](https://mvnrepository.com/artifact/org.apache.nifi/nifi-record) I can compile and run the maven successfully.
According to maven repo dependency both these should be declared with the scope `provided`. So I did that.
In my processor now I have `LookupService` used as follows.
public static final PropertyDescriptor CLIENT_LOOKUP_SERVICE =
new PropertyDescriptor.Builder()
.name("Client CSV Lookup service")
.identifiesControllerService(LookupService.class)
.required(true)
.build();
Also in the onShedule() I use it as follows
@Override
public void onScheduled(ProcessContext context) {
this.clientNiFiLookupService = context.getProperty(CLIENT_LOOKUP_SERVICE).asControllerService(LookupService.class);
}
Now the problem is I cannot package the nar. It doesn't like the I excluded the LookupService class. even if I remove provided scope it doesn't get included as well.
[INFO] Generating documentation for NiFi extensions in the NAR...
[INFO] Found a dependency on version 1.13.0 of NiFi API
[ERROR] Could not generate extensions' documentation
java.lang.NoClassDefFoundError: org/apache/nifi/lookup/LookupService
...
...
[ERROR] Failed to execute goal org.apache.nifi:nifi-nar-maven-plugin:1.3.1:nar (default-nar) on project nifi-decoder-processors-nar: Execution default-nar of goal org.apache.nifi:nifi-nar-maven-plugin:1.3.1:nar failed: A required class was missing while executing org.apache.nifi:nifi-nar-maven-plugin:1.3.1:nar: org/apache/nifi/lookup/LookupService
[ERROR] -----------------------------------------------------
[ERROR] realm = extension>org.apache.nifi:nifi-nar-maven-plugin:1.3.1
So how do we use this LookupService in our custom processors?