![](/img/trans.png)
[英]NiFi developing custom processor: import org.apache.nifi.processors error
[英]Error during the creating of custom processors apache nifi
我尝试使用mvn clean package
命令构建我的 package 和 NiFi 定制处理器,我得到了以下 output:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.794 s
[INFO] Finished at: 2021-05-17T14:33:42+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile
(groovy-tests) on project mycustom-processor: Execution groovy-tests of goal
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile failed:
Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies
could not be resolved: Failed to collect dependencies at
org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1
-> org.codehaus.groovy:groovy-eclipse-batch:jar:2.5.4-01: Failed to read artifact descriptor for
org.codehaus.groovy:groovy-eclipse-batch:jar:2.5.4-01: Could not transfer artifact
org.codehaus.groovy:groovy-eclipse-batch:pom:2.5.4-01 from/to bintray
(https://dl.bintray.com/groovy/maven):
Access denied to: https://dl.bintray.com/groovy/maven/org/codehaus/groovy/groovy-eclipse-batch/2.5.4-01/groovy-eclipse-batch-2.5.4-01.pom,
ReasonPhrase: Forbidden. -> [Help 1]
[ERROR]
有人知道如何处理与maven-compiler-plugin:3.8.1:testCompile相关的问题吗? 我使用 Apache NiFi 版本 1.13.2 和mvn install -DskipTests
没有改变任何东西。
这个错误的原因是 pom 的 url 不可访问。
目前,groovy-eclipse-batch-2.5.4-01.pom 链接被禁止。(dl.bintray.com/groovy/maven/org/codehaus/groovy/groovy-eclipse-batch/2.5.4-01/groovy- eclipse-batch-2.5.4-01.pom)
检查 maven 存储库中是否存在 groovy-eclipse-batch。 或者只是在 mvnrepository.com 上找到一个有效版本并使用它。 ( https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch )
例如,将 groovy-eclipse-batch 的版本更改为 2.5.6-01。
尝试将以下内容添加到捆绑项目的父 pom 中:
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.5.6-01</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
添加依赖之前:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (groovy-tests) on project mytest: Execution groovy-tests of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.1 -> org.codehaus.groovy:groovy-eclipse-batch:jar:2.5.4-01: Failed to read artifact descriptor for org.codehaus.groovy:groovy-eclipse-batch:jar:2.5.4-01: Could not transfer artifact org.codehaus.groovy:groovy-eclipse-batch:pom:2.5.4-01 from/to bintray (https://dl.bintray.com/groovy/maven): Access denied to: https://dl.bintray.com/groovy/maven/org/codehaus/groovy/groovy-eclipse-batch/2.5.4-01/groovy-eclipse-batch-2.5.4-01.pom -> [Help 1]
添加依赖后:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for mytest 1.0.0-SNAPSHOT:
[INFO]
[INFO] mytest ............................................. SUCCESS [ 3.611 s]
[INFO] nifi-mytestnar-processors .......................... SUCCESS [ 11.278 s]
[INFO] nifi-mytestnar-nar ................................. SUCCESS [ 0.983 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.448 s
将以下属性添加到您的 pom.xml
<nifi.groovy.version>2.5.6</nifi.groovy.version>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.