3 This project is a tool to experiment with generating a Nifi Processor POJO from a DCAE component spec.
5 Environment variables needed to run the app:
9 `GENPROC_WORKING_DIR` - Full file path to the directory where you will generate class files to and ultimately build the jar to distribute
10 `GENPROC_ONBOARDING_API_HOST` - Onboarding API host URL
11 `GENPROC_PROCESSOR_CLASSFILE_PATH` - Path to the DCAEProcessor class file
15 `GENPROC_JAR_INDEX_URL` - URL to the index.json for DCAE processor jars
19 NOTE: You need a specific version of the `nifi-api` jar that contains the class `BaseDCAEProcessor`.
21 Command to build and to copy dependencies into `target/dependency` directory:
24 mvn clean package dependency:copy-dependencies
27 ## Run - Generate jars
29 This will pull all component specs from onboarding API and for each component:
31 * A class file is generated for a new DCAEProcessor class
32 * Write metadata into META-INF directory
33 * Copy a copy of the DCAEProcessor class file
34 * Package up into a jar
39 java -cp "target/genprocessor-1.0.1.jar:target/dependency/*" org.onap.dcae.genprocessor.App gen
42 ### More about what goes into META-INF
44 #### Processor manifest
46 Note the META-INF directory which contains:
52 └── org.apache.nifi.processor.Processor
55 If you don't have the above in your `GENPROC_TARGET_DIR`, then:
58 $ mkdir -p META-INF/services
59 $ touch META-INF/services/org.apache.nifi.processor.Processor
62 Open `META-INF/services/org.apache.nifi.processor.Processor` and write the full class name for each generated processor on a separate line.
66 Write the `MANIFEST.MF` in a file that's arbitrarily named (mymanifest for example). The content should look like:
71 Id: dcae-ves-collector
78 This will load all jars listed on an index page and for each jar will do a class load and quick test.
83 java -cp "target/genprocessor-1.0.1.jar:target/dependency/*" org.onap.dcae.genprocessor.App load