Kevin Doran created NIFI-11217:
----------------------------------
Summary: 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
Fix For: nifi-nar-maven-plugin-1.5.0
It appears that the NAR maven plugin was benefiting from behavior in older
version of the maven-dependency-tree library we use for how it resolved
provided artifacts in a way that 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 this dependency, and 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. This
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
(ExtensionClassLoaderFactory.java:101)
at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:531)
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)
{noformat}
Specifically, such artifacts are not guaranteed to be in the local repository
and need to be resolved using remote repositories, which they are not in the
current plugin implementation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)