Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5B1810B11 for ; Fri, 7 Feb 2014 16:05:39 +0000 (UTC) Received: (qmail 91653 invoked by uid 500); 7 Feb 2014 16:05:34 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 91542 invoked by uid 500); 7 Feb 2014 16:05:34 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 91534 invoked by uid 99); 7 Feb 2014 16:05:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Feb 2014 16:05:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [24.37.79.202] (HELO smtp.artifact-software.com) (24.37.79.202) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Feb 2014 16:05:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.artifact-software.com (Postfix) with ESMTP id CA37AFEC048 for ; Fri, 7 Feb 2014 11:05:07 -0500 (EST) X-Virus-Scanned: amavisd-new at artifact-software.com Received: from smtp.artifact-software.com ([127.0.0.1]) by localhost (smtp.artifact-software.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7L5XdObHbh6g for ; Fri, 7 Feb 2014 11:04:57 -0500 (EST) Received: from [192.168.3.170] (unknown [192.168.3.170]) by smtp.artifact-software.com (Postfix) with ESMTP id D9B4AFEC046 for ; Fri, 7 Feb 2014 11:04:57 -0500 (EST) Message-ID: <52F50425.50107@artifact-software.com> Date: Fri, 07 Feb 2014 11:04:53 -0500 From: Ron Wheeler Reply-To: Maven Users List Organization: Artifact Software User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Maven Users List Subject: Re: maven-ear-plugin silently overrides libraries References: <52F4EED5.2040305@artifact-software.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------010309050500000702070100" X-Virus-Checked: Checked by ClamAV on apache.org --------------010309050500000702070100 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Exclusions will not help in this case. Looking through the dependency hierarchy will at least get you to see the problem earlier which I think was the nature of your question. It appears from my brief reading and fun with making servlets run in production that classloaders merge classes by name. Maven does not. I am a bit surprised that groupId does not count. If one uses a lot of third -party libraries, it would seem inevitable that you could need com.artifact-software:utilities:1.0 at the same time as ch.rethab:utilities:1.0 at the same time. The classloader is not going to cause any problem but if Maven throws out one of these as a duplicate, you will be missing classes at run-time. It is difficult to force everyone to create unique artifactIds unless you get rid of the GroupId altogther and make GAV -> and put the group name into the artifactID. This seems to be a design flaw if it is true. Ron On 07/02/2014 9:43 AM, Reto Habl�tzel wrote: > Sure, but exclusions don't do the trick if you need both of them, do > they? I am talking about completely independent libraries that happen > to have the same artifactId. > > Those were actually both libraries of mine and I could obviously fix > this issue rather simply, but I was just thinking that it would be > helpful to have at least a warning or something from maven - > regardless of the IDE. > > - Reto > > > On Fri, Feb 7, 2014 at 3:33 PM, Ron Wheeler > > wrote: > > If your IDE supports Maven (Eclipse/STS for example), you will see > the conflict in the dependency hierarchy view and you can fix it > with the right exclusions. > > It is almost always worth a quick look through the dependency > hierarchy view if you use a lot of third party libraries. > Not everyone updates their dependencies when they build a > shareable library. > You can sometimes get some pretty old versions of things dragged > in with the latest version of otherwise well-written libraries. > Exclusions need to be added to get what you want in your artifacts. > > Ron > > > On 07/02/2014 9:21 AM, Reto Habl�tzel wrote: > > Hi there, > > I built an ear using the maven-ear-plugin (version 2.6). > > The ear is configured such that it includes two libraries into > the lib > folder, both with the same artifactId as well as the same > version, but a > different groupId. Now if I simply call 'mvn package' only the > first one is > included, but no warning whatsoever appears. Only once I turn > on debugging > (mvn --debug package), I see one subtle message: > [DEBUG] Skipping artifact [jar:com.foo:bar:1.0] as it is > already up to date > at [lib/bar-1.0.jar] > > Wouldn't it make sense to either include the groupId in the > filename or at > least make a check (that includes the groupId) beforehand if > there are any > conflicts? > > Cheers, > Reto > > > > -- > Ron Wheeler > President > Artifact Software Inc > email: rwheeler@artifact-software.com > > skype: ronaldmwheeler > phone: 866-970-2435, ext 102 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > > For additional commands, e-mail: users-help@maven.apache.org > > > -- Ron Wheeler President Artifact Software Inc email: rwheeler@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 --------------010309050500000702070100--