Mark,

The dependency duplication detection is a new optional goal of the NAR
plugin. The basic purpose is to detect unnecessary dependencies in the
compile scope, which are already provided from a parent NAR dependency.

For example, the nifi-standard-service-api-nar includes the
nifi-ssl-context-service-api library. The nifi-web-client-provider-service
depends on nifi-ssl-context-service-api, and identifies it correctly with
the provided scope in the Maven configuration. The
nifi-web-client-provider-service-nar bundles
nifi-web-client-provider-service, and depends on
nifi-standard-service-api-nar. If the nifi-ssl-context-service-api was not
marked as provided, the new duplication detection goal would flag the
unnecessary inclusion of the nifi-ssl-context-service-api.

The duplication detection will help avoid including unnecessary
dependencies, and also avoid unexpected runtime behavior. The NiFi NAR
class loading hierarchy uses libraries from the parent NAR at runtime, so
avoiding unnecessary dependency inclusion is important for these reasons.
The goal is optional, and will require additional changes to enable by
default in NiFi builds, but it should be very helpful for future releases.

Regards,
David Handermann

On Wed, Nov 30, 2022 at 7:36 AM Mark Bean <mark.o.b...@gmail.com> wrote:

> Sounds great Kevin. Thanks!
>
> Can you give a little more detail on the dependency duplication detection?
> How does it work? Does it detect different versions of the same dependency?
> Is it detecting duplicates only within a given NAR or across multiple NARs?
>
> Thanks,
> Mark
>
>
> On Tue, Nov 29, 2022 at 4:18 PM Kevin Doran <kdo...@apache.org> wrote:
>
> > Hi all,
> >
> > There’s been a few improvements and bug fixes to the NAR Maven Plugin.
> One
> > nice new feature is a new maven goal that detects duplicate dependencies
> in
> > NARs. Another contribution improves our NiFi build reproducibility.
> >
> > Given all this, I’d like to release a new version of the plugin that we
> can
> > start using in NiFi. As this includes a feature, this will be a minor
> > version bump (1.4.0).
> >
> > I’m happy to RM. There are two outstanding PRs, and if there are no
> > objections on this thread, I’ll wait for those to be merged and then
> > prepare a release candidate.
> >
> > Thanks,
> > Kevin
> >
>

Reply via email to