먼저 만들 곳으로 이동해서
cd /Users/jobyeonghui/apps/nifi/custom_processor
[~/apps/nifi/custom_processor]$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> am.ik.archetype:maven-reactjs-blank-archetype (Blank Project for React.js)
2: remote -> am.ik.archetype:msgpack-rpc-jersey-blank-archetype (Blank Project for Spring Boot + Jersey)
3: remote -> am.ik.archetype:mvc-1.0-blank-archetype (MVC 1.0 Blank Project)
4: remote -> am.ik.archetype:spring-boot-blank-archetype (Blank Project for Spring Boot)
5: remote -> am.ik.archetype:spring-boot-docker-blank-archetype (Docker Blank Project for Spring Boot)
6: remote -> am.ik.archetype:spring-boot-gae-blank-archetype (GAE Blank Project for Spring Boot)
7: remote -> am.ik.archetype:spring-boot-jersey-blank-archetype (Blank Project for Spring Boot + Jersey)
8: remote -> at.chrl.archetypes:chrl-spring-sample (Archetype for Spring Vaadin Webapps)
9: remote -> br.com.address.archetypes:struts2-archetype (an archetype web 3.0 + struts2 (bootstrap + jquery) + JPA 2.1 with struts2 login system)
1597: remote -> us.fatehi:schemacrawler-archetype-maven-project (-)
1598: remote -> us.fatehi:schemacrawler-archetype-plugin-command (-)
1599: remote -> us.fatehi:schemacrawler-archetype-plugin-dbconnector (-)
1600: remote -> us.fatehi:schemacrawler-archetype-plugin-lint (-)
엄청 많이 나오는데 이중에 nifi 를 사용할 것이기에 추려보면
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 784: wifi
현재는 두 가지가 있네요. 프로세서 만들 것이기에 1번을 선택하고
Choose archetype:
1: remote -> org.apache.nifi:nifi-processor-bundle-archetype (-)
2: remote -> org.apache.nifi:nifi-service-bundle-archetype (-)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
최신 버전인 0.6.1 을 선택하고 나머지는 적당히 넣는다.
Choose org.apache.nifi:nifi-processor-bundle-archetype version:
1: 0.0.2-incubating
2: 0.1.0-incubating
3: 0.2.0-incubating
4: 0.2.1
5: 0.3.0
6: 0.4.0
7: 0.4.1
8: 0.5.0
9: 0.5.1
10: 0.6.0
11: 0.6.1
Choose a number: 11: 11
Define value for property 'groupId': :
[~/apps/nifi/custom_processor]$ cd nifi-processor/
[~/apps/nifi/custom_processor/nifi-processor]$ ll
total 16
drwxr-xr-x 5 jobyeonghui staff 170B 5 24 03:08 nifi-demo-nar
drwxr-xr-x 6 jobyeonghui staff 204B 5 24 03:06 nifi-demo-processors
-rw-r--r-- 1 jobyeonghui staff 1.3K 5 24 03:00 nifi-processor.iml
-rw-r--r-- 1 jobyeonghui staff 1.4K 5 24 02:50 pom.xml
drwxr-xr-x 4 jobyeonghui staff 136B 5 24 03:08 target
[~/apps/nifi/custom_processor/nifi-processor]$ mvn package
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 3 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 3 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] nifi-processor
[INFO] nifi-demo-processors
[INFO] nifi-demo-nar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nifi-processor 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven) @ nifi-processor ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ nifi-processor ---
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (groovy-tests) @ nifi-processor ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ nifi-processor ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nifi-demo-processors 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven) @ nifi-demo-processors ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ nifi-demo-processors ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ nifi-demo-processors ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ nifi-demo-processors ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ nifi-demo-processors ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-processors/src/test/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ nifi-demo-processors ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (groovy-tests) @ nifi-demo-processors ---
[INFO] Changes detected - recompiling the module!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18:test (default-test) @ nifi-demo-processors ---
[INFO] Surefire report directory: /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-processors/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running nifi.processors.demo.MyProcessorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.165 sec - in nifi.processors.demo.MyProcessorTest
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ nifi-demo-processors ---
[INFO] Building jar: /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-processors/target/nifi-demo-processors-1.0.jar
[INFO]
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ nifi-demo-processors ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nifi-demo-nar 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-maven) @ nifi-demo-nar ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ nifi-demo-nar ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ nifi-demo-nar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-nar/src/main/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ nifi-demo-nar ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ nifi-demo-nar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-nar/src/test/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ nifi-demo-nar ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (groovy-tests) @ nifi-demo-nar ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.18:test (default-test) @ nifi-demo-nar ---
[INFO]
[INFO] --- nifi-nar-maven-plugin:1.1.0:nar (default-nar) @ nifi-demo-nar ---
[INFO] Copying nifi-demo-processors-1.0.jar to /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-nar/target/classes/META-INF/bundled-dependencies/nifi-demo-processors-1.0.jar
[INFO] commons-lang3-3.4.jar already exists in destination.
[INFO] nifi-processor-utils-0.6.1.jar already exists in destination.
[INFO] commons-io-2.4.jar already exists in destination.
[INFO] nifi-security-utils-0.6.1.jar already exists in destination.
[INFO] nifi-utils-0.6.1.jar already exists in destination.
[INFO] Building jar: /Users/jobyeonghui/apps/nifi-0.6.1/custom_processor/nifi-processor/nifi-demo-nar/target/nifi-demo-nar-1.0.nar
[INFO]
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) @ nifi-demo-nar ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] nifi-processor ..................................... SUCCESS [ 4.946 s]
[INFO] nifi-demo-processors ............................... SUCCESS [ 3.774 s]
[INFO] nifi-demo-nar ...................................... SUCCESS [ 0.572 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.092 s
[INFO] Finished at: 2016-05-25T14:12:52+09:00
[INFO] Final Memory: 25M/217M
[INFO] ------------------------------------------------------------------------
개발할 때는 아래 파일 수정하고 빌드 한다.
[~/apps/nifi/custom_processor/nifi-processor/nifi-demo-processors/src/main/java/nifi/processors/demo]$ ll
total 8
-rw-r--r-- 1 jobyeonghui staff 3.6K 5 24 03:04 MyProcessor.java
패키징이 끝나면
~/apps/nifi/custom_processor/nifi-processor/nifi-demo-nar/target]$ ll
total 1576
drwxr-xr-x 3 jobyeonghui staff 102B 5 24 03:08 classes
drwxr-xr-x 3 jobyeonghui staff 102B 5 24 03:08 maven-archiver
drwxr-xr-x 3 jobyeonghui staff 102B 5 24 03:08 maven-shared-archive-resources
-rw-r--r-- 1 jobyeonghui staff 786K 5 25 14:12 nifi-demo-nar-1.0.nar
drwxr-xr-x 3 jobyeonghui staff 102B 5 24 03:08 test-classes
target 안에 nor 파일이 있는데 이것을 nifi/lib 에 넣어주고 재기동을 하면 프로세서 컴포넌트로 등록이 된다.
[~/apps/nifi/custom_processor/nifi-processor/nifi-demo-nar/target]$ cd ~/apps/nifi/lib
[~/apps/nifi/lib]$ ll
total 846416
drwxr-xr-x 16 jobyeonghui staff 544B 5 24 01:35 bootstrap
-rw-r-----@ 1 jobyeonghui staff 16K 12 3 05:15 jcl-over-slf4j-1.7.12.jar
-rw-r-----@ 1 jobyeonghui staff 4.6K 12 3 05:04 jul-to-slf4j-1.7.12.jar
-rw-r-----@ 1 jobyeonghui staff 24K 12 3 05:11 log4j-over-slf4j-1.7.12.jar
-rw-r-----@ 1 jobyeonghui staff 274K 12 3 05:04 logback-classic-1.1.3.jar
-rw-r-----@ 1 jobyeonghui staff 444K 12 3 05:04 logback-core-1.1.3.jar
-rw-r-----@ 1 jobyeonghui staff 3.6M 4 13 10:54 nifi-ambari-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.1M 4 13 10:55 nifi-amqp-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 189K 4 13 10:42 nifi-api-0.6.1.jar
-rw-r-----@ 1 jobyeonghui staff 5.1M 4 13 10:55 nifi-avro-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 27M 4 13 10:54 nifi-aws-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.5M 4 13 10:55 nifi-azure-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 7.4M 4 13 10:55 nifi-cassandra-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 5.7M 4 13 10:55 nifi-couchbase-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.0M 4 13 10:53 nifi-dbcp-service-nar-0.6.1.nar
-rw-r--r-- 1 jobyeonghui staff 786K 5 24 03:09 nifi-demo-nar-1.0.nar
-rw-r-----@ 1 jobyeonghui staff 882K 4 13 10:53 nifi-distributed-cache-services-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 34K 4 13 10:43 nifi-documentation-0.6.1.jar
-rw-r-----@ 1 jobyeonghui staff 20M 4 13 10:55 nifi-elasticsearch-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 32M 4 13 10:54 nifi-flume-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 40M 4 13 10:48 nifi-framework-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 3.5M 4 13 10:54 nifi-geo-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 31M 4 13 10:49 nifi-hadoop-libraries-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 21M 4 13 10:49 nifi-hadoop-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.7M 4 13 10:54 nifi-hbase-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 34M 4 13 10:53 nifi-hbase_1_1_2-client-service-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 10M 4 13 10:54 nifi-hl7-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.1M 4 13 10:55 nifi-html-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 790K 4 13 10:53 nifi-http-context-map-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.2M 4 13 10:54 nifi-image-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.4M 4 13 10:49 nifi-jetty-bundle-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 848K 4 13 10:55 nifi-jms-cf-service-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.7M 4 13 10:55 nifi-jms-processors-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 14M 4 13 10:54 nifi-kafka-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.0M 4 13 10:55 nifi-kerberos-iaa-providers-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 21M 4 13 10:54 nifi-kite-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 3.3M 4 13 10:54 nifi-language-translation-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.4M 4 13 10:55 nifi-ldap-iaa-providers-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.9M 4 13 10:54 nifi-mongodb-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 33K 4 13 10:43 nifi-nar-utils-0.6.1.jar
-rw-r-----@ 1 jobyeonghui staff 20K 4 13 10:43 nifi-properties-0.6.1.jar
-rw-r-----@ 1 jobyeonghui staff 4.6M 4 13 10:50 nifi-provenance-repository-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 2.4M 4 13 10:55 nifi-riemann-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 28K 4 13 10:43 nifi-runtime-0.6.1.jar
-rw-r-----@ 1 jobyeonghui staff 57M 4 13 10:55 nifi-scripting-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.3M 4 13 10:54 nifi-social-media-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 3.3M 4 13 10:54 nifi-solr-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 1.3M 4 13 10:55 nifi-splunk-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 802K 4 13 10:55 nifi-spring-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 792K 4 13 10:53 nifi-ssl-context-service-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 20M 4 13 10:53 nifi-standard-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 825K 4 13 10:49 nifi-standard-services-api-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 4.6M 4 13 10:53 nifi-update-attribute-nar-0.6.1.nar
-rw-r-----@ 1 jobyeonghui staff 31K 12 3 05:02 slf4j-api-1.7.12.jar
간혹 잘 못된 프로세서가 등록될 경우 별다른 오류 메세지도 없이 nifi 서비스가 올라오지 않는 경우가 발생할 수 있으니 중의한다.
'Biz > Etc' 카테고리의 다른 글
BPMN 자습서 : 비즈니스 프로세스 모델 및 표기법에 대한 빠른 시작 안내서 (0) | 2020.03.06 |
---|---|
Maven Skipping Tests (0) | 2016.05.26 |
Hortonwork ambari admin password reset (0) | 2016.05.20 |
a loading into HDFS - Part1 (0) | 2016.05.18 |
배치로 Hive 로 보내기 (0) | 2016.04.03 |
댓글