How to remove unnecessary classes from fastutil with maven?

235 views
Skip to first unread message

NikNik77771

unread,
Sep 29, 2011, 9:15:13 PM9/29/11
to fastutil
How to remove unnecessary classes from fastutil with maven?

Dawid Weiss

unread,
Sep 30, 2011, 4:45:13 AM9/30/11
to fast...@googlegroups.com
What do you mean?
Dawid

Nikolay Rychkov

unread,
Sep 30, 2011, 6:02:18 AM9/30/11
to fast...@googlegroups.com
I mean a library is huge. In production I would like to use smaller one without classes that I actually not to use in my project. I want to know does somebody have experience in maven plugins usage to perform this task?

2011/9/30 Dawid Weiss <dawid...@gmail.com>

Dawid Weiss

unread,
Sep 30, 2011, 6:03:12 AM9/30/11
to fast...@googlegroups.com
Use Eric Lafortune's proguard. I'm sure there's a maven plugin for it,
but I didn't look around.

Dawid

Nikolay Rychkov

unread,
Sep 30, 2011, 6:06:37 AM9/30/11
to fast...@googlegroups.com
Thank you for advise. That is I am exploring now. May be somebody has an example pom?

2011/9/30 Dawid Weiss <dawid...@gmail.com>

Michael Ekstrand

unread,
Sep 30, 2011, 8:40:42 AM9/30/11
to fast...@googlegroups.com
On 09/29/2011 08:15 PM, NikNik77771 wrote:
> How to remove unnecessary classes from fastutil with maven?
Use maven-shade-plugin. It will let you copy the Fastutil classes you
use into a single jar with your project.

- Michael

--
Michael Ekstrand <ekst...@cs.umn.edu>
Ph.D candidate, Computer Science -- University of Minnesota
GroupLens Research: http://www.grouplens.org
window manager, n: a program for arranging multiple Emacs frames

Dawid Weiss

unread,
Sep 30, 2011, 10:02:59 AM9/30/11
to fast...@googlegroups.com
I'd still recommend proguard -- it has a lot more tuning knobs and can
do pretty much anything what you may come up with (single jar output,
package flattening, renaming, whatever). It's one of the greatest
bytecode engineering tool I've come across.

Dawid

NikNik77771

unread,
Sep 30, 2011, 6:59:59 PM9/30/11
to fastutil
Code example is really appreciated. Anyway thank you very much indeed.

On Sep 30, 6:02 pm, Dawid Weiss <dawid.we...@gmail.com> wrote:
> I'd still recommend proguard -- it has a lot more tuning knobs and can
> do pretty much anything what you may come up with (single jar output,
> package flattening, renaming, whatever). It's one of the greatest
> bytecode engineering tool I've come across.
>
> Dawid
>
>
>
>
>
>
>
> On Fri, Sep 30, 2011 at 2:40 PM, Michael Ekstrand <ekstr...@cs.umn.edu> wrote:
> > On 09/29/2011 08:15 PM, NikNik77771 wrote:
> >> How to remove unnecessary classes from fastutil with maven?
> > Use maven-shade-plugin. It will let you copy the Fastutil classes you
> > use into a single jar with your project.
>
> > - Michael
>
> > --
> > Michael Ekstrand <ekstr...@cs.umn.edu>

Dawid Weiss

unread,
Sep 30, 2011, 7:12:29 PM9/30/11
to fast...@googlegroups.com
Google.
D.

Nikolay Rychkov

unread,
Sep 30, 2011, 7:13:30 PM9/30/11
to fast...@googlegroups.com
LOL 

2011/10/1 Dawid Weiss <dawid...@gmail.com>
330.gif

Dawid Weiss

unread,
Jan 4, 2012, 2:59:38 AM1/4/12
to NikNik77771, fast...@googlegroups.com
Of course it is possible with Maven. Like I said: if you google around
there's plenty of solutions. I use my own version of Proguard to trim
and repackage third party dependencies here:

https://github.com/carrotsearch/randomizedtesting/blob/master/ant-junit4/pom.xml

But there are also more "standard" solutions like maven shade plugin:

http://maven.apache.org/plugins/maven-shade-plugin/

Like they say: everything is possible (given more time, resources,
money or any combination of the above...).
Dawid

On Wed, Jan 4, 2012 at 8:52 AM, NikNik77771 <nikolay...@gmail.com> wrote:
> I investigated a problem. Unfortunatly I was not able to find solution
> with maven. The simplest way is treating resulting war file with
> standard proguard command line way.

NikNik77771

unread,
Jan 4, 2012, 4:29:04 AM1/4/12
to fastutil
Do you mean that shade plugin remove unnecessary classes from
dependencies?
Is you proguard pom acceptable for regular proguard?

On 4 янв, 11:59, Dawid Weiss <dawid.we...@gmail.com> wrote:
> Of course it is possible with Maven. Like I said: if you google around
> there's plenty of solutions. I use my own version of Proguard to trim
> and repackage third party dependencies here:
>
> https://github.com/carrotsearch/randomizedtesting/blob/master/ant-jun...

Dawid Weiss

unread,
Jan 4, 2012, 4:40:12 AM1/4/12
to fast...@googlegroups.com
> Do you mean that shade plugin remove unnecessary classes from
> dependencies?

RTFM and search for an attribute "minimizeJar"...
http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html

> Is you proguard pom acceptable for regular proguard?

You haven't looked at that pom, have you? It uses an external proguard
JAR embedded in the project so you can substitute any version of
proguard you like (or make it a dependency if you wish). I use a
custom version because I need special package renaming which isn't in
proguard by default.

This is my final e-mail. I recommend that you read this before asking
more questions:
http://catb.org/~esr/faqs/smart-questions.html

Dawid

Nikolay Rychkov

unread,
Jan 4, 2012, 4:43:59 AM1/4/12
to fast...@googlegroups.com
I am sorry. Thank you vey much. You have done a lot of.

Nikolay Rychkov

unread,
Jan 4, 2012, 4:47:24 AM1/4/12
to fast...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages