views:

479

answers:

1

Hey guys,

I can't quite figure out how to add all of my .jar dependencies to my client jar.

This is what I have so far:

<target name="create-metrics-client" depends="clean,build">
    <jar destfile="sd-metrics-client.jar" basedir="${build.home}">
        <manifest>
            <attribute name="Main-Class" value="com.mycompany.client.MetricsDaemon"/>
        </manifest>
        <include name="com/mycompany/client/*"/>
        <include name="com/mycompany/portable/util/*"/>
        <include name="com/mycompany/request/*"/>
        <include name="com/mycompany/model/*"/>
        <include name="com/mycompany/controller/*"/>
        <include name="lib/*"/>
    </jar>
</target>

Basically, this copies all the dependencies to the jar, but the main code cannot find these. I need a way to add that manifest attribute so that it knows where to look. I've already tried a few things, to no avail.

Thank you very much in advance guys!

A: 

You can't nest JAR files like that. If you want to do such a thing, you need to use a tool such as OneJar or UberJar.

skaffman