You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Magesh Umasankar <um...@apache.org> on 2002/09/03 22:53:26 UTC

Jar file from Verbose Output

Hi,
I propose to create a task that reads in the output 
of java -verbose:class MyApp (stored in a file)
and create a jar file that contains all the classes
that were loaded to run MyApp.

The use case is described here (though the 
implementation is not quite elegant enough)
http://www.michaelmoser.org/jarjar/jarjar.htm

Weblogic ships with a verboseToZip utility too,
primarily to create a jar that contains just those
weblogic files that are needed for a remote EJB 
client to run without having to have the huge 
weblogic.jar copied over to the client machine 
as well.

The task's syntax would be:

<verbosetojar srcFile="verbose.txt" 
              destFile="mini.jar"
              <!-- optional --> manifest="mymanifest.mf">
    <!-- optional -->
    <patternset>
        <exclude name="java**"/>
    </patternset>
</verbosetojar>

Would such a task be useful?

Cheers,
Magesh

**************************************************
*  Opportunist: A person who starts taking bath  *
*  if he accidentally falls into a river.        *
**************************************************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Jar file from Verbose Output

Posted by Jesse Stockall <je...@cryptocard.com>.
On Wed, 2002-09-04 at 02:45, Stefan Bodewig wrote:
> Can't you achieve the same by using a <classfileset> to create your
> jar?
> 
A <classfileset> works well if all the class files are on disk. 

This type of task should be able to include dependent classes from
external jar files, and optionally the entire jar file.

Jesse

 --
 Jesse Stockall
 jesse@cryptocard.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Jar file from Verbose Output

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 3 Sep 2002, Magesh Umasankar <um...@apache.org> wrote:

> I propose to create a task that reads in the output 
> of java -verbose:class MyApp (stored in a file)
> and create a jar file that contains all the classes
> that were loaded to run MyApp.

Can't you achieve the same by using a <classfileset> to create your
jar?

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Jar file from Verbose Output

Posted by Jesse Stockall <je...@cryptocard.com>.
On Tue, 2002-09-03 at 16:53, Magesh Umasankar wrote:
> Hi,
> I propose to create a task that reads in the output 
> of java -verbose:class MyApp (stored in a file)
> and create a jar file that contains all the classes
> that were loaded to run MyApp.
> 

Sounds exactly like GenJar. I use GenJar to build jars that contain all
the required class dependencies. It works great for Applets and for
creating self contained jars.

I've got a modified version that will output the classes to disk, so
they can then be obfuscated, or used as the source for the <ejbjar>
task.

The only time I have had a problem with the list of dependencies is with
log4j, Log4j uses dynamic loading of appenders, so the dependencies
can't be determined properly. In this case GenJar allows me to include
the whole log4j.jar into my new jar file, and problem solved.


-- 
 Jesse Stockall
 jesse@cryptocard.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>