Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E05D18419 for ; Mon, 17 Aug 2015 10:22:32 +0000 (UTC) Received: (qmail 33225 invoked by uid 500); 17 Aug 2015 10:22:32 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 33193 invoked by uid 500); 17 Aug 2015 10:22:32 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 33181 invoked by uid 99); 17 Aug 2015 10:22:31 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Aug 2015 10:22:31 +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 67A4218210A for ; Mon, 17 Aug 2015 10:22:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.901 X-Spam-Level: ** X-Spam-Status: No, score=2.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=cloudsoftcorp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JeyvA9KglXZH for ; Mon, 17 Aug 2015 10:22:18 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 2500520756 for ; Mon, 17 Aug 2015 10:22:18 +0000 (UTC) Received: by oiev193 with SMTP id v193so76809991oie.3 for ; Mon, 17 Aug 2015 03:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudsoftcorp.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=h/Nk6wKzauWC/KiKTlA3yL2ZP36AaM2A/qv9T7/V3lY=; b=YZS/nnq2tJM4rDGaCmWoZxB4l6zOUSYvnqGZhu2D4eI5bkmz+JwNdzkwCjDPPvrPzM S2McHPxxlVZV1ZOf6Fy4wEJMgNx/oAy779tNTjbbNPG89ERKZn5XFSzYvTfLOjltYo6Y nWelcWbPxRpueuMQRJnc5FXUKaJnA+bAZqLp8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=h/Nk6wKzauWC/KiKTlA3yL2ZP36AaM2A/qv9T7/V3lY=; b=gEz5D7gaVT4ys3Ub/iQUuVabpSs68oGu0o0IHDW937kOhQlASSdXfl3HhrUsF00tRF JtBLBoJTJkXOMXJ6rjzzoh06zVioi7qQFi7rwxtJcxFGBHui+Nc84ehpGd8hhYAzLQDt 4eM6ohbu9egkzATkRsisGqSUy3W+CQrvx+2wT6rCh2KP9VlBNCghX+gjtxOnfDqUgWFX rQ9jSCUZvYrCDKoQnDgbgG3E4dodOLvSSsJOczoA8aMUq2gHz+q3etElFwPd7I877AIx PsLlSPSYN2JxOBO6lpdsO7ESmzM67FxvEKRxD4f0gZy9ucuoKj67IHBDjh/WMQ90XMGb cfoQ== X-Gm-Message-State: ALoCoQkQW+Zi3HZVTL5xwMsh4tIIksUSFpZR/bSsda2htmt26rh14qEDFtEZBf6dft3JLAdQv63XsJ8Q6ZKImKLto952T2uZk9gWEGaYImWzaaFF0mmlZ4tl64vV1pWlJuVjMjivv/YQiDnIV+SlNfWmnNhPKIzJqw== X-Received: by 10.202.75.2 with SMTP id y2mr529654oia.116.1439806937233; Mon, 17 Aug 2015 03:22:17 -0700 (PDT) MIME-Version: 1.0 References: <55D1AF9A.3080601@gmail.com> In-Reply-To: From: Thomas Bouron Date: Mon, 17 Aug 2015 10:22:07 +0000 Message-ID: Subject: Re: Third party dependencies To: dev@brooklyn.incubator.apache.org Content-Type: multipart/alternative; boundary=001a113e3db80a1464051d7f2d9b --001a113e3db80a1464051d7f2d9b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable // Internal Hi Aled. Yes, I'm talking about the bdaap project, more specifically brooklyn-ambari[1] and this PR[2]. We have only one dependency[3] that need to be bundled within the generated jar. [1] https://github.com/brooklyncentral/brooklyn-ambari [2] https://github.com/brooklyncentral/brooklyn-ambari/pull/24 [3] https://github.com/brooklyncentral/brooklyn-ambari/pull/24#discussion_r3697= 6777 On Mon, 17 Aug 2015 at 11:18 Thomas Bouron wrote: > Hi Richard, Aled. > > Thanks for sharing. I checked the retrofit library but it seems that they > don't provide an OSGi bundle of it so this is dead end. > I do feel like Aled on Richard's comment about copy-pasting source code. = I > don't think that is particularly suitable for retrofit either as it has a > fair amount of code. > > That leaves the maven shade or assembly plugin. I would go for the second > one based on its home page and plugin description but it's a gut feeling. > > On Mon, 17 Aug 2015 at 10:55 Aled Sage wrote: > >> Hi Thomas, >> >> Longer term, OSGi is a great way to go: creating OSGi bundle(s) for your >> code, which reference your dependencies as other OSGi bundles - e.g. >> when you deploy your app to the catalog, reference your bundle and its >> dependencies in the "brooklyn.libraries" section of a catalog item [1]. >> >> However, that can prove fiddly, particularly if your dependencies are >> not shipped as OSGi bundles. >> >> --- >> If using the dropins folder... If using maven-shade-plugin then take >> care that it does not pull in brooklyn-api etc (you don't really want >> those duplicated inside your shaded jar). >> >> For Richard's comment about copy-pasting the code with renamed package >> names... I see where he's coming from but personally don't like it >> unless unavoidable and/or very small. It can give you some parts of >> "OSGi-like behaviour" (e.g. avoids version conflicts, but does not give >> you on-the-fly upgrading etc). However, when your dependencies have >> transitive dependencies, it can get fiddly and large. >> >> Aled >> >> [1] https://brooklyn.incubator.apache.org/v/latest/ops/catalog/ >> >> >> On 17/08/2015 10:39, Richard Downer wrote: >> > Hi Thomas, >> > >> > For Brooklyn itself, there are many rules based in copyright law and >> Apache >> > policy that affect how this is done. Essentially, if the licenses are >> > compatible, then there's no issue with bundling dependencies into the >> > project, provided that the bundled package is correctly attributed in >> the >> > right places. The gold reference document for Apache is at [1], and my >> > interpretation of how this specifically applies to Brooklyn is at [2]. >> > >> > However if you're writing an external library that is not part of Apac= he >> > Brooklyn - you are merely consuming Apache Brooklyn by dropping in an >> extra >> > library - then the Apache policies do not apply to you! You do still >> need >> > to consider copyright law however, so I advise that you let the Apache >> > policy 'inspire' you as it was written with compliance of the law a ke= y >> > requirement :-) >> > >> > I see that retrofit has an Apache license. This is a permissive >> (non-viral) >> > license so you're unlikely to have a problem with it, although it >> depends >> > on the license of your project. >> > >> > In practical terms, yes, maven-shade-plugin will do the trick, and I >> think >> > maven-assembly-plugin can do it too. However you need to be aware that >> > these kinds of tools will invalidate signed JARs. In practice these ar= e >> > rarely a problem - we have observed an issue where BouncyCastle is >> degraded >> > if it's not signed, but I've not seen any other kind of problem. >> > >> > Personally, I don't really like shading, as it obscures transitive >> > dependencies. The technique taken by several projects is to physically >> copy >> > in the source code with a different package name (e.g. >> > com.example.myproject.com.google.common.collect.Iterables) and I think >> I >> > prefer that technique. It's just a gut feel though, I cannot provide a= ny >> > facts to back it up :-) >> > >> > Richard. >> > >> > [1] https://www.apache.org/legal/resolved.html >> > [2] >> https://brooklyn.incubator.apache.org/v/latest/dev/code/licensing.html >> > >> > On Mon, 17 Aug 2015 at 09:58 Thomas Bouron < >> thomas.bouron@cloudsoftcorp.com> >> > wrote: >> > >> >> Hi devs. >> >> >> >> I'm currently working on a project for a client where I want to use >> this >> >> library[1] for all my REST call. It is released under the Apache >> licence >> >> v2. >> >> >> >> My project will be released as a jar and placed under the Brookyln's >> >> dropins folder but I rather have only one jar containing all my >> >> dependencies instead of adding my third party library jar one by one. >> >> >> >> Now I'm not sure if I can do that from a licensing point of view. Do >> you >> >> have any thoughts? Also, If there is no issue to do so, what is the >> best >> >> practice in that matter? Using the maven shade plugin? >> >> >> >> Thanks. >> >> >> >> Best. >> >> >> >> [1] http://square.github.io/retrofit/ >> >> -- >> >> Thomas Bouron =E2=80=A2 Software Engineer @ Cloudsoft Corporation =E2= =80=A2 >> >> http://www.cloudsoftcorp.com/ >> >> Github: https://github.com/tbouron >> >> Twitter: https://twitter.com/eltibouron >> >> >> >> -- >> >> Cloudsoft Corporation Limited, Registered in Scotland No: SC349230. >> >> Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP >> >> >> >> This e-mail message is confidential and for use by the addressee only= . >> If >> >> the message is received by anyone other than the addressee, please >> return >> >> the message to the sender by replying to it and then delete the messa= ge >> >> from your computer. Internet e-mails are not necessarily secure. >> Cloudsoft >> >> Corporation Limited does not accept responsibility for changes made t= o >> this >> >> message after it was sent. >> >> >> >> Whilst all reasonable care has been taken to avoid the transmission o= f >> >> viruses, it is the responsibility of the recipient to ensure that the >> >> onward transmission, opening or use of this message and any attachmen= ts >> >> will not adversely affect its systems or data. No responsibility is >> >> accepted by Cloudsoft Corporation Limited in this regard and the >> recipient >> >> should carry out such virus and other checks as it considers >> appropriate. >> >> >> >> -- > Thomas Bouron =E2=80=A2 Software Engineer @ Cloudsoft Corporation =E2=80= =A2 > http://www.cloudsoftcorp.com/ > Github: https://github.com/tbouron > Twitter: https://twitter.com/eltibouron > --=20 Thomas Bouron =E2=80=A2 Software Engineer @ Cloudsoft Corporation =E2=80=A2 http://www.cloudsoftcorp.com/ Github: https://github.com/tbouron Twitter: https://twitter.com/eltibouron --=20 Cloudsoft Corporation Limited, Registered in Scotland No: SC349230.=20 Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP =20 This e-mail message is confidential and for use by the addressee only. If= =20 the message is received by anyone other than the addressee, please return= =20 the message to the sender by replying to it and then delete the message=20 from your computer. Internet e-mails are not necessarily secure. Cloudsoft= =20 Corporation Limited does not accept responsibility for changes made to this= =20 message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of=20 viruses, it is the responsibility of the recipient to ensure that the=20 onward transmission, opening or use of this message and any attachments=20 will not adversely affect its systems or data. No responsibility is=20 accepted by Cloudsoft Corporation Limited in this regard and the recipient= =20 should carry out such virus and other checks as it considers appropriate. --001a113e3db80a1464051d7f2d9b--