[jira] [Updated] (NIFI-11217) NiFi NAR Maven Plugin fails to build external NARs with transitive, provided dependencies.

2023-03-08 Thread Bryan Bende (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-11217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bryan Bende updated NIFI-11217:
---
Resolution: Fixed
Status: Resolved  (was: Patch Available)

> NiFi NAR Maven Plugin fails to build external NARs with transitive, provided 
> dependencies.
> --
>
> Key: NIFI-11217
> URL: https://issues.apache.org/jira/browse/NIFI-11217
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Tools and Build
>Affects Versions: nifi-nar-maven-plugin-1.4.0
>Reporter: Kevin Doran
>Assignee: Kevin Doran
>Priority: Major
> Fix For: nifi-nar-maven-plugin-1.5.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> It appears that the NAR maven plugin was benefiting from behavior in older 
> version of the maven-dependency-tree library that would resolve artifacts in 
> addition to poms when crawling dependendncies. This guaranteed that they 
> would be in the local Maven repository/cache when in the Extension 
> Documentation generation phase of NAR building.
> Version 1.4.0 of the plugin upgraded maven-dependency-tree to 3.2.0, which 
> included this behavior change to only download poms:
> https://github.com/apache/maven-dependency-tree/commit/b330fa93b70e35c70a8afa75f0404cf47d5935d6
>  
> This broke building NARs that are external from the Apache NiFi 
> repository/project that inherit from (or depend on) NiFi NARs that have 
> transitive dependencies marked as provided, because the Extension 
> Documentation generation needs the full artifact resolved in order to create 
> a working ClassLoader. Not having artifacts resolved results in error 
> messages such as:
> {noformat}
> [INFO] --- nifi-nar-maven-plugin:1.4.0:nar (default-nar) @ 
> nifi-example-processors-nar ---
> [INFO] Copying nifi-example-processors-1.0.jar to 
> /Users/kdoran/dev/code/nifi-dependency-example/nifi-inherits-processor-bundle/nifi-example-processors-nar/target/classes/META-INF/bundled-dependencies/nifi-example-processors-1.0.jar
> [INFO] Generating documentation for NiFi extensions in the NAR...
> [INFO] Found NAR dependency of 
> org.apache.nifi:nifi-standard-services-api-nar:nar:1.20.0:compile
> [INFO] Found NAR dependency of 
> org.apache.nifi:nifi-jetty-bundle:nar:1.20.0:compile
> [INFO] Found a dependency on version 1.20.0 of NiFi API
> [ERROR] Could not generate extensions' documentation
> org.apache.maven.plugin.MojoExecutionException: Failed to create Extension 
> Documentation
> at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:534)
> at org.apache.nifi.NarMojo.execute (NarMojo.java:505)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
> at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke (Method.java:566)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:282)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:225)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:347)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Could not resolve 
> local dependency org.apache.nifi:nifi-framework-api:jar:1.20.0
> at 
> 

[jira] [Updated] (NIFI-11217) NiFi NAR Maven Plugin fails to build external NARs with transitive, provided dependencies.

2023-03-08 Thread Kevin Doran (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-11217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Doran updated NIFI-11217:
---
Status: Patch Available  (was: In Progress)

> NiFi NAR Maven Plugin fails to build external NARs with transitive, provided 
> dependencies.
> --
>
> Key: NIFI-11217
> URL: https://issues.apache.org/jira/browse/NIFI-11217
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Tools and Build
>Affects Versions: nifi-nar-maven-plugin-1.4.0
>Reporter: Kevin Doran
>Assignee: Kevin Doran
>Priority: Major
> Fix For: nifi-nar-maven-plugin-1.5.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> It appears that the NAR maven plugin was benefiting from behavior in older 
> version of the maven-dependency-tree library that would resolve artifacts in 
> addition to poms when crawling dependendncies. This guaranteed that they 
> would be in the local Maven repository/cache when in the Extension 
> Documentation generation phase of NAR building.
> Version 1.4.0 of the plugin upgraded maven-dependency-tree to 3.2.0, which 
> included this behavior change to only download poms:
> https://github.com/apache/maven-dependency-tree/commit/b330fa93b70e35c70a8afa75f0404cf47d5935d6
>  
> This broke building NARs that are external from the Apache NiFi 
> repository/project that inherit from (or depend on) NiFi NARs that have 
> transitive dependencies marked as provided, because the Extension 
> Documentation generation needs the full artifact resolved in order to create 
> a working ClassLoader. Not having artifacts resolved results in error 
> messages such as:
> {noformat}
> [INFO] --- nifi-nar-maven-plugin:1.4.0:nar (default-nar) @ 
> nifi-example-processors-nar ---
> [INFO] Copying nifi-example-processors-1.0.jar to 
> /Users/kdoran/dev/code/nifi-dependency-example/nifi-inherits-processor-bundle/nifi-example-processors-nar/target/classes/META-INF/bundled-dependencies/nifi-example-processors-1.0.jar
> [INFO] Generating documentation for NiFi extensions in the NAR...
> [INFO] Found NAR dependency of 
> org.apache.nifi:nifi-standard-services-api-nar:nar:1.20.0:compile
> [INFO] Found NAR dependency of 
> org.apache.nifi:nifi-jetty-bundle:nar:1.20.0:compile
> [INFO] Found a dependency on version 1.20.0 of NiFi API
> [ERROR] Could not generate extensions' documentation
> org.apache.maven.plugin.MojoExecutionException: Failed to create Extension 
> Documentation
> at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:534)
> at org.apache.nifi.NarMojo.execute (NarMojo.java:505)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
> at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)
> at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
> at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
> at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke (Method.java:566)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:282)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:225)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:406)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:347)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Could not resolve 
> local dependency org.apache.nifi:nifi-framework-api:jar:1.20.0
> at 
> 

[jira] [Updated] (NIFI-11217) NiFi NAR Maven Plugin fails to build external NARs with transitive, provided dependencies.

2023-02-25 Thread Kevin Doran (Jira)


 [ 
https://issues.apache.org/jira/browse/NIFI-11217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Doran updated NIFI-11217:
---
Description: 
It appears that the NAR maven plugin was benefiting from behavior in older 
version of the maven-dependency-tree library that would resolve artifacts in 
addition to poms when crawling dependendncies. This guaranteed that they would 
be in the local Maven repository/cache when in the Extension Documentation 
generation phase of NAR building.

Version 1.4.0 of the plugin upgraded maven-dependency-tree to 3.2.0, which 
included this behavior change to only download poms:
https://github.com/apache/maven-dependency-tree/commit/b330fa93b70e35c70a8afa75f0404cf47d5935d6
 

This broke building NARs that are external from the Apache NiFi 
repository/project that inherit from (or depend on) NiFi NARs that have 
transitive dependencies marked as provided, because the Extension Documentation 
generation needs the full artifact resolved in order to create a working 
ClassLoader. Not having artifacts resolved results in error messages such as:

{noformat}
[INFO] --- nifi-nar-maven-plugin:1.4.0:nar (default-nar) @ 
nifi-example-processors-nar ---
[INFO] Copying nifi-example-processors-1.0.jar to 
/Users/kdoran/dev/code/nifi-dependency-example/nifi-inherits-processor-bundle/nifi-example-processors-nar/target/classes/META-INF/bundled-dependencies/nifi-example-processors-1.0.jar
[INFO] Generating documentation for NiFi extensions in the NAR...
[INFO] Found NAR dependency of 
org.apache.nifi:nifi-standard-services-api-nar:nar:1.20.0:compile
[INFO] Found NAR dependency of 
org.apache.nifi:nifi-jetty-bundle:nar:1.20.0:compile
[INFO] Found a dependency on version 1.20.0 of NiFi API
[ERROR] Could not generate extensions' documentation
org.apache.maven.plugin.MojoExecutionException: Failed to create Extension 
Documentation
at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:534)
at org.apache.nifi.NarMojo.execute (NarMojo.java:505)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:81)
at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not resolve 
local dependency org.apache.nifi:nifi-framework-api:jar:1.20.0
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.getProvidedArtifact
 (ExtensionClassLoaderFactory.java:224)
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.createProvidedEntitiesClassLoader
 (ExtensionClassLoaderFactory.java:258)
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.createClassLoader
 (ExtensionClassLoaderFactory.java:116)
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.createClassLoader
 (ExtensionClassLoaderFactory.java:122)
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.createClassLoader
 (ExtensionClassLoaderFactory.java:122)
at 
org.apache.nifi.extension.definition.extraction.ExtensionClassLoaderFactory.createExtensionClassLoader