简体   繁体   中英

ant build.xml read in manifest file

How can i read in a manifest file instead of usign a xml coded manifest in my build.xml file.

This is what i have so far in my MANIFEST.MF

Manifest-Version: 1.0
Created-By: 1123523 (Stefan Sprenger)
Main-Class: studentapp.MainStart

And here is the workaround in my code, which i don't want to use anymore

<jar jarfile="jar/A12-${DSTAMP}.jar" basedir="${build}">
        <manifest>
            <attribute name="Main-Class" value="studentapp.MainStart"/>
        </manifest>
</jar>

Ant's Jar task lets you specify a manifest file to use as attribute of the jar-element:

<jar manifest="yourfile.mf">
    <!-- other stuff -->
</jar>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM