Menu

#4 manifest file problem

open
nobody
None
5
2003-04-11
2003-04-11
No

I don't believe the manifest file correctly specifies
its download extensions. Maintaining an external
manifest file is unnecessary anyway since it can be
generated by the build file.

<http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Main%20Attributes>

Add following to 'build.xml' and delete 'src/manifest.txt'

<property name="package.name"
value="de.micromata.${project.name}"/>
<property name="main.class"
value="${package.name}.ProfileViewer"/>
<property name="manifest.filename"
value="${project.name}.mf"/>
<property name="manifest.file"
location="${build.dir}/${manifest.filename}"/>

<target name="manifest">
<!-- creates jar manifest -->
<manifest file="${manifest.file}">
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path"
value="lib/crimson.jar"/>
<attribute name="Class-Path" value="lib/jaxp.jar"/>
<attribute name="Class-Path"
value="lib/log4j-core.jar"/>
</manifest>
</target>

Change 'jar' target as follows:

<target name="jar"
depends="compile, manifest" <-- here
description="==> Makes jar file">
<jar jarfile="${lib.name}.jar"
manifest="${manifest.file}" <-- here
basedir="${build.classes}">
<include name="**/*.class" />
<include name="**/*.properties" />
</jar>
</target>

Discussion


Log in to post a comment.