目标:实现从restful接口读取到nifi
第一步:创建processor项目结构
创建maven项目
项目名nifi-rest-bundle
完成创建项目:
修改 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
<version>1.12.1</version>
</parent>
<groupId>com.lk.nifi.rest</groupId>
<artifactId>nifi-rest-bundle</artifactId>
<name>nifi-rest-bundle</name>
<packaging>pom</packaging>
</project>
同上述步骤在nifi-rest-bundle中创建两个模块:nifi-rest-nar 和 nifi-rest-processors
注:示例中我删除了不必要的文件,如:测试文件目录等
nifi-rest-nar 模块中的pom 配置:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.lk.nifi.rest</groupId>
<artifactId>nifi-rest-bundle</artifactId>
<version>1.12.1</version>
</parent>
<artifactId>nifi-rest-nar</artifactId>
<packaging>nar</packaging>
<name>nifi-rest-nar</name>
<dependencies>
<dependency>
<groupId>com.lk.nifi.rest</groupId>
<artifactId>nifi-rest-processors</artifactId>
<version>1.12.1</version>
</dependency>
</dependencies>
</project>
nifi-rest-processors 模块 的pom 配置:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="