我正在开发一个定制处理器,它同时使用DBCPService
和RecordReader
。
对于maven项目,我不能添加两个服务的NAR依赖项,因为这会导致错误。
对于我的处理器模块pom.xml,
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-utils</artifactId>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-mock</artifactId>
<version>1.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-api</artifactId>
<version>1.12.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-record-serialization-service-api</artifactId>
<version>1.12.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-record</artifactId>
<version>1.12.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
我的处理器子模块
<dependencies>
<dependency>
<groupId>com.suntecgroup.xelerate</groupId>
<artifactId>nifi-record-processors</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-record-serialization-services-nar</artifactId>
<version>1.12.0</version>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-dbcp-service-nar</artifactId>
<version>1.12.0</version>
<type>nar</type>
</dependency>
</dependencies>
如何将两个控制器服务的依赖项添加到处理器中呢?
1条答案
按热度按时间krugob8w1#
NAR依赖项应该在包含服务API的NAR上,而不是在包含这些API的实现的NAR上。对于你的例子,
nifi-dbcp-service-api
和nifi-record-serialization-service-api
都是nifi-standard-services-api-nar
的一部分,所以你只需要这个: