From dev-return-16252-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Tue Jan 16 16:17:26 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 584DD18065B for ; Tue, 16 Jan 2018 16:17:26 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 49581160C34; Tue, 16 Jan 2018 15:17:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6764B160C26 for ; Tue, 16 Jan 2018 16:17:25 +0100 (CET) Received: (qmail 98109 invoked by uid 500); 16 Jan 2018 15:17:19 -0000 Mailing-List: contact dev-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list dev@nifi.apache.org Received: (qmail 98097 invoked by uid 99); 16 Jan 2018 15:17:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jan 2018 15:17:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C7B5E18086C for ; Tue, 16 Jan 2018 15:17:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id HcVnXjSJBtkC for ; Tue, 16 Jan 2018 15:17:17 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 7DDE75FB5E for ; Tue, 16 Jan 2018 15:17:17 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id i11so9288251wmf.4 for ; Tue, 16 Jan 2018 07:17:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=CnYNSYODapvuqsSpzxxTzGryWhC9M9q2AYlX7UqlHDo=; b=ZJsEppCnK20UfPQe0M8ezzLR5nAq0UMg5Mn5Ly2LKGDyIxU2nzx6BzAXTpyXYZaDDw 9OyAZ7MKWl8h+m56kjA+7sLP3GDpTxkRqghVzL8lsubKobZtcZo1tH5PQTok68vKM3aw k3USom9/iwzY3t/S3gDofnRxojDYT8m3GgHMQmAe2+xRMo9gRR/LG+l+SxLFYaG7UdN5 6JtRdsRwpJ+RYmE6a5/maiV2uNIJCVsszGlvpUrBqfo+Ifu+KC3dlqu3C1y9PvhHVdJy qbfQzllvNS+g5EVABImLvGzzuNGIza7B2LFvbrJ50FO1PgigyHxJicf3fjMtSUAtqWn7 nAwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=CnYNSYODapvuqsSpzxxTzGryWhC9M9q2AYlX7UqlHDo=; b=thw80UYuM0YAi/26XW0xDv2r3avlBJ+HfgawaInkkFiGIvwQKYlS7JpPBsqfhRhcz+ /XWF+JDweA4PM8vBxA1z1rpVmAi1u2Tt8S1LxmaASwXe64gGGHG2AmlRVtbKRhnYSGHn V8bC+gu7rmIVw/5gTSWPgMF/LwC6GWhooHgG1McoWk6mMT2f0kvixWmF0aUWy8q/xoWn pkiEmrKFWAOFZl4Mm8TejNYk9Xbj+6QfjohkQ9x3GLBHERR+Yv0hP+wO3ddOrFIrhq6h hSu2XG5kEooV7J58KXwezATNkvhfFVOHaash/FJ+S/xOPGvAYVsiQqWci6cwlgC41UhN +ZJA== X-Gm-Message-State: AKwxyteXykBJkUh/qHTV5fTbeoZmNoJLPG2OskQM53nbqb3HmWF9/dE8 FU2y83W0erttDJRis0zyDZ9yyhi+kbEuyT5ZtRuoh3YB X-Google-Smtp-Source: ACJfBovV56w7YXxL4yqo8Zb2BxjWYfa0nq2fqLQbOAp239V5S7V1FbWMx3DUZ4WLYKN03Qa2PyxxtiQZB1TItm2fUQI= X-Received: by 10.28.156.206 with SMTP id f197mr14688640wme.112.1516115836092; Tue, 16 Jan 2018 07:17:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.171.27 with HTTP; Tue, 16 Jan 2018 07:17:15 -0800 (PST) In-Reply-To: References: From: Bryan Bende Date: Tue, 16 Jan 2018 10:17:15 -0500 Message-ID: Subject: Re: how to declare dependency? To: dev@nifi.apache.org Content-Type: text/plain; charset="UTF-8" Anything that is intended to be re-used across NARs should be packaged into a utility module that each NAR could include. For example, all of the modules under nifi-extensions-utils [1] contain re-usable code that NARs can share. This case is different because it is not a service API, it just resuable code that will be included any given NAR using a standard compile dependency. [1] https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-extension-utils On Tue, Jan 16, 2018 at 6:50 AM, Martin Mucha wrote: > To extend this question a little bit further. This is imaginatory problem, > but I feel the answer to it will help me in future. > > Lets say, that I need to have dependency on nifi-record or some module > providing interface. I cannot add it as compile scope dependency, since > otherwise existing implementors of won't work, as they are existing in > another classloader only, and noone implements interface bundled in my nar. > That's clear. I have to add dependency on nar in nar module, and provided > scope dependency in module with processor. Easy. > > Now I want to reuse another thing from different nar. Uuups, does not work, > I cannot add 2 nar dependencies. What can one do with that? I assume there > isn't (severe) reusability limitation, that one cannot reuse classes from > more than one nar, right? > > Mar. > > 2018-01-15 22:50 GMT+01:00 Martin Mucha : > >> Thanks guys! >> >> Just to sum our case up for potential future readers. We did try to define >> such libraries as 'compile' scope, but (probably due to nar packaging) we >> was now providing those 'dependencies' in our nar. Not what we wanted. >> Example: there was missing one module, which contained only interface. >> Marking it as compile fixed errors, but then we wasn't able to use >> implementors of such interface, because now this interface was issued by >> our nar, and obviously noone implemented that one. >> >> Instead, when we declared dependency on nifi-standard-services-api-nar, >> provided scope worked ok, and everything else as well. >> >> Thanks for your help! >> Martin. >> >> 2018-01-12 16:29 GMT+01:00 Bryan Bende : >> >>> In addition to what Matt said, the reason nifi-record is marked as >>> provided is because it is part of nifi-standard-services-api-nar, and >>> if your NAR was going to do anything with a record reader/writer you >>> would have a NAR dependency on nifi-standard-services-api-nar so at >>> runtime that is where your NAR would get nifi-record from. At build >>> time it gets it from the provided dependency in order to compile. >>> >>> On Fri, Jan 12, 2018 at 10:16 AM, Matt Gilman >>> wrote: >>> > Mar, >>> > >>> > By using a dependency like that (without the version), it must be >>> declared >>> > in dependencyManagement someplace. If the jar isn't being pulled into >>> the >>> > resulting artifact it's likely because the dependency has a scope of >>> > provided. You can override that scope to compile when you reference it. >>> > >>> > Matt >>> > >>> > On Fri, Jan 12, 2018 at 8:34 AM, Martin Mucha >>> wrote: >>> > >>> >> Hi, >>> >> >>> >> in nifi-standard-processors there is this dependency >>> >> >>> >> >>> >> org.apache.nifi >>> >> nifi-record >>> >> >>> >> >>> >> if I just copy paste into our project some class from this bundle (to >>> fix >>> >> bugs) and add dependencies as mentioned one, it builds. However nifi >>> wont >>> >> start, because nifi-record related classes are not on classpath. >>> >> >>> >> What shall I do to get them on classpath? For nifi-standard-processors >>> it's >>> >> fine to have nifi-record as provided, but apparently for our project, >>> >> extending the same parent, it's not. nifi-record is not provided or >>> part of >>> >> built nar. How to fix this? >>> >> >>> >> thanks, >>> >> Mar. >>> >> >>> >> >>