maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Minimize an Uber Jar correctly, Using Shade-Plugin
Date Wed, 11 Jan 2012 10:18:07 GMT
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 <SBlitz@nds.com> 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-plugin/examples/includes-excludes.html,
the size of the jar can be minimized by using:
>
>  <configuration>
>      <minimizeJar>true</minimizeJar>
> </configuration>
>
> But this feature does not take into consideration the classes that are declared 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 refers to interface
A and my Spring file contains an instantiation of class B that implements A, then B might
not be added to the jar, since it's not in the 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 postmaster@nds.com and delete it from
your system as well as any copies. The content 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 necessary.
>
> 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


Mime
View raw message