Error during the creating of custom processors apache nifi
Asked Answered
S

2

12

I tried to build my package with NiFi custom-processor using mvn clean package command and I got the following 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] 

Does anybody know how to handle this issue related to the maven-compiler-plugin:3.8.1:testCompile, please ? I use Apache NiFi version 1.13.2 and mvn install -DskipTests does not change anything.

Sternum answered 17/5, 2021 at 12:58 Comment(2)
maybe the reason that bintray is going to be closed... jfrog.com/blog/…Hinojosa
This the way to build custom nifi processors ,Build a Custom NiFi processorColeencolella
R
9

The reason for this error is that the pom's url is not accessable.

Currently, groovy-eclipse-batch-2.5.4-01.pom link is forbidden.(dl.bintray.com/groovy/maven/org/codehaus/groovy/groovy-eclipse-batch/2.5.4-01/groovy-eclipse-batch-2.5.4-01.pom)

Check if groovy-eclipse-batch exists in your maven repository. Or just find a valid version on mvnrepository.com and use it. (https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-eclipse-batch)

For example, change version of groovy-eclipse-batch to 2.5.6-01.

Try adding the following to your parent pom for the bundle project :

<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>

Before add the dependency :

[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]

After add the dependency :

[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
Rigi answered 4/6, 2021 at 5:30 Comment(2)
Thanks. This helped a lot. Just to add a little for those of us not super familiar with Maven. You can change the source/target of the plugin if you are not using Java 8. And the groovy-eclipse-batch dependency version can also correspond to the available options if you want to use a newer version: mvnrepository.com/artifact/org.codehaus.groovy/… I think anyway. Not a Maven expert, but it worked for me. :DExtravaganza
I am very angry with jFrog / Artifactory for making me do extra work. This is the 3rd time this has come up. Migrating to Nexus. They really couldn't have just setup a mirror?Other
I
5

Add the below property to your pom.xml

    <nifi.groovy.version>2.5.6</nifi.groovy.version>
Ihs answered 30/9, 2021 at 8:4 Comment(2)
you made my dayHagridden
This one works great. Baiscally issue is 'org.codehaus.groovy:groovy-eclipse-batch:pom:2.5.4-01' is no longer available on mvncentral and above property changes required version to 2.5.6 which is available. Checkout mvnrepository.com/artifact/org.codehaus.groovy/…Darvon

© 2022 - 2024 — McMap. All rights reserved.