5

I need to reduce the size of JAR file in my project which is 9.17MB,I have already reduced it to 6.31MB by removing all the logger statements and dead code.I also have checked each JAR file individually by removing it and compiling it.With which I have removed upto 6 files.

Now I want to reduce the size of JAR file upto 2 to 3 MB, and I have decided to use the tool JBoss Tattletale,

Has anybody used it before? and If yes then please provide me the steps to install and run it. BTW I have already downloaded that tool from www.jboss.org website.

Thanks in advance!

2 Answers 2

6

First you need to download the tool from the website. Or you can go directly to their sourceforge project location and download the latest version.

After you have downloaded it and unpacked, run from the terminal:

$ java -Xmx512m -jar tattletale.jar ~/Java/workspaces/mycoolprojects/projectX output-projectx

assuming that the location to you project is ~/Java/workspaces/mycoolprojects/projectX, and that you want the generated report to be stored in folder called output-projectx

Best, Nikola

0

If you are using maven for your project you can use their plugin. Please change the below location accordingly.

<source> - the folder where your project resides

<destination> - where you need the reports to be generated

<build>
<plugins>
    <plugin>
        <groupId>org.jboss.tattletale</groupId>
        <artifactId>tattletale-maven</artifactId>
        <!-- The version of the plugin you want to use -->
        <version>1.1.0.Final</version>
        <executions>
            <execution>
                <goals>
                    <goal>report</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
                <!-- This is the location which will be scanned for generating tattletale reports
            -->
            <source>/absolute/path/to/reports/dir</source>
            <!-- This is where the reports will be generated -->
            <destination>/absolute/path/to/reports/dir</destination>
        </configuration>
    </plugin>
</plugins>

then run mvn clean package

If you don't want your tests to run then add flag -DskipTests in the end

you can see the output folder (/absolute/path/to/reports/dir) has files created.

Open index.html to view reports

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.