Thanks Bryan,

I restarted with a fresh maven generate, and only added the API to the 
processor pom, and then the API-NAR to the NAR pom. I then figured out a 
subsequent dependency (lang3), and got that in, and now my processor shows up 
in local NiFi instance.

Regarding the copying of the standard processor, when I copied Wait over, I 
renamed it from Wait to MyProcessorWait to be unique, and not copied. I'm just 
attempting changes to Wait without modifying the actual one. Also, thanks on 
the META-INF/services file information.

Now I can debug and test.

Sincerely,
John McGinn

--------------------------------------------
On Tue, 10/16/18, Bryan Bende <bbe...@gmail.com> wrote:

 Subject: Re: Compiling custom processor
 To: dev@nifi.apache.org
 Date: Tuesday, October 16, 2018, 9:52 AM
 
 In general, if your processor
 uses a controller service then the
 processors pom file needs a provided dependency
 on the API of the CS,
 and your NAR pom needs
 a NAR dependency on the NAR where the CS API
 is.
 
 Example is
 shown here in the section linking processors and
 controller
 services - 
https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions
 
 Also, you do not want to
 include NiFI's standard processors in your
 own NAR, this will result in two copies of
 every standard processor.
 You will want to
 copy whatever code you need into your own NAR.
 
 In you last statement, if you
 made a new processor in
 nifi-standard-processors and it didn't show
 up, it is most likely
 because you didn't
 update META-INF/services file to include the new
 processor.
 On Tue, Oct 16, 2018 at
 9:36 AM John McGinn
 <amruginn-n...@yahoo.com.invalid>
 wrote:
 >
 > Ok, I am
 far from a maven expert, and am struggling on this
 problem.
 >
 > I created
 a new project using the maven generate process, and compiled
 that sample processor and everything was fine, and I could
 see it in my local NiFi instance. I then copied over the
 Wait processor on top of the MyProcessor.java class, changed
 the package name, and the class name, and attempted to
 compile. Got errors due to dependency issues. This is where
 I get confused.
 >
 > In
 the processor directory, I modify the pom.xml with a
 dependency line for nifi-api, nifi-utils,
 nifi-distribute-cache-client-service-api and
 nifi-standard-processors. This seemed to make things work,
 and I get a 33 meg NAR file, which contains lots of JARs. I
 load that up, and I get a problem with CalculateStats, or
 similar, because of RecordReaderFactory. I go back in and
 include nifi-record-serialization-services, and it compiles,
 and the JAR is included in the NAR file now, and I still get
 class not found.
 >
 >
 I've also tried to change the dependencies to a status
 of provided, and therefore get a minimal 25k or so NAR file
 with no JARs included. I get the same issue with the class
 not found.
 >
 > I had
 also attempted to copy Wait.java to AnotherWait.java within
 the actually NiFi source code, and it compiles, and shows up
 in the JARs and NARs as I'd expect, but I cannot get to
 it within my NiFi instance.
 >
 > Can someone let me know what I'm doing
 wrong.
 >
 > Thanks,
 > John McGinn

Reply via email to