0

I need help to modify the classpath in my JAR manifest.mf file. Here's my scenario:

I am trying to make Netbeans build multiple JAR files for this project. I managed to create an Ant target that build the various JAR files. I used ant-contrib's for task and Netbeans built-in -pre-jar target:

<property name="multipleJar.basePackage" value="com.mycompany.myproject"/>
<property name="multipleJar.baseDirectory" value="com/mycompany/myproject"/>

<target name="-pre-jar">
    <!-- Packing mutiple jars -->
    <dirset dir="build/classes/${multipleJar.baseDirectory}" includes="*" id="elementid"/> 
    <for list="${toString:elementid}" delimiter=";" param="filename"> 
        <sequential>
            <delete file="dist/multiple/lib/${multipleJar.basePackage}.@{filename}.jar"/>
            <jar destfile="dist/multiple/lib/${multipleJar.basePackage}.@{filename}.jar" 
                filesetmanifest="skip"
                basedir="build/classes/"
                includes="**/${multipleJar.baseDirectory}/@{filename}/*">
            </jar>
        </sequential> 
    </for>
</target>

The JAR generation seems OK, but now i have to modify the Manifest.mf file on the MAIN jar, so these new (dynamically generated) jar files are included in the ClassPath.

Please Advise.

phrfpeixoto
  • 191
  • 1
  • 2
  • 11

1 Answers1

0

I recommend using the manifestclasspath ANT task.

For an example see:

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185