Return-Path: X-Original-To: apmail-maven-dev-archive@www.apache.org Delivered-To: apmail-maven-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7999B9E9C for ; Wed, 11 Jan 2012 10:23:52 +0000 (UTC) Received: (qmail 63020 invoked by uid 500); 11 Jan 2012 10:19:13 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 62748 invoked by uid 500); 11 Jan 2012 10:18:41 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 62704 invoked by uid 99); 11 Jan 2012 10:18:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2012 10:18:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stephen.alan.connolly@gmail.com designates 74.125.82.171 as permitted sender) Received: from [74.125.82.171] (HELO mail-we0-f171.google.com) (74.125.82.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2012 10:18:28 +0000 Received: by werg1 with SMTP id g1so1036720wer.30 for ; Wed, 11 Jan 2012 02:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Gxm0fiPOBgMYx9G1ZsbVZk0vTW1riTYgg/0hv1wd/ZA=; b=QhXLLRFmPnd3eUg2pYtRJEdTAe61NYAQ8LbVP9IiZzBdlCeRB5+7HBs0cBpg7iZUP5 y1ClFmWWVNpskvV4SHprn8G13UY3Y0ebi8dqmw8uRg3rnJIFfJ8RBGsYOnZQ8iu5cKrU T5HV3xqze51ttdKp0Tmxhqcx3jnEKa78M3bfw= MIME-Version: 1.0 Received: by 10.216.139.195 with SMTP id c45mr2493381wej.18.1326277087838; Wed, 11 Jan 2012 02:18:07 -0800 (PST) Received: by 10.216.89.204 with HTTP; Wed, 11 Jan 2012 02:18:07 -0800 (PST) In-Reply-To: <0EF910CAF05F52468F9FD80AE8533EC893EFB3C6B8@ILMA1.IL.NDS.COM> References: <0EF910CAF05F52468F9FD80AE8533EC893EFB3C6B8@ILMA1.IL.NDS.COM> Date: Wed, 11 Jan 2012 10:18:07 +0000 Message-ID: Subject: Re: Minimize an Uber Jar correctly, Using Shade-Plugin From: Stephen Connolly To: Maven Users List Cc: Maven Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Moving to Users list as this is a question for people developing WITH maven not a question for people developing maven. At present there is no solution, other than having those classes referenced from a referenced class. Shade has no way of knowing that you use properties files to pull in classes via dynamic class loading, as there are sooo sooo many ways you could set that up. While we are on dev@m.a.o A fix would be to allow you to specify classes that should be retained in the minimized jar as a plugin parameter. Would you like to try and write a patch to shade for such a feature? If you are willing to take a shot, please open a JIRA, attach the patch (with tests if you want to stand a chance of getting the patch applied) and give me or the dev@m.a.o list a ping and somebody will apply the patch (assuming you have written tests and used the Maven formatting, but once you have a patch written we can help you get that stuff sorted) It would be relatively easy to do, just not an itch that any of the current committers has needed to scratch. -Stephen On 11 January 2012 09:46, Blitz, Shmuel wrote: > Dear fellows, > > I am using the Maven-Shade-Plugin to create a runnable Uber-jar. > According to the last frame on maven.apache.org/plugins/maven-shade-plugi= n/examples/includes-excludes.html, the size of the jar can be minimized by = using: > > =A0 > =A0 =A0 =A0true > > > But this feature does not take into consideration the classes that are de= clared in the log4j.properties file. Hence, e.g. org.apache.log4j.appender.= TimeAndSizeRollingAppender is not included in the Uber-jar, even though it'= s declared in the log4j.properties file. > > I believe I will face the same problem with Spring. If my code only refer= s to interface A and my Spring file contains an instantiation of class B th= at implements A, then B might not be added to the jar, since it's not in th= e code. > > How can I solve this problem? > > You input will be highly appreciated. > > Thanks in advance, > Shmuel Blitz > > ________________________________ > This message is confidential and intended only for the addressee. If you = have received this message in error, please immediately notify the postmast= er@nds.com and delete it from your system as well as any copies. The conten= t of e-mails as well as traffic data may be monitored by NDS for employment= and security purposes. > To protect the environment please do not print this e-mail unless necessa= ry. > > An NDS Group Limited company. www.nds.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org