How to generate relative classpath for manifest with Ant

N

Nick de Graeve

I want my build file to generate the Class-Path of the manifest.
I have some solution but it generates absolute paths instead of
relative ones.

What do i need to change?

Nick.

excerpt of build.xml:
<target name="package-developer">
<jar destfile="developer.jar">
<zipfileset refid="fileset"></zipfileset>
<manifest>
<attribute name="Main-Class" value="developer.NokeosDeveloper"
/>
<attribute name="Class-Path" value="${class-path}" />
</manifest>
</jar>
</target>

<path id="class.path">
<fileset dir="." >
<include name="lib/**/*.jar"/>
</fileset>
</path>

<pathconvert property="class-path" pathsep=" ">
<path refid="class.path"></path>
</pathconvert>

manifest.mf:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
Main-Class: developer.NokeosDeveloper
Class-Path: C:\projects\doc\docs\prototypes\lib\jide-action.jar C:\pro
jects\doc\docs\prototypes\lib\jide-common.jar C:\projects\doc\docs\pr
ototypes\lib\jide-components.jar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top