ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26300] - manifest task munges classpath entries
Date Thu, 22 Jan 2004 03:06:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26300>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26300

manifest task munges classpath entries





------- Additional Comments From conor@cortexebusiness.com.au  2004-01-22 03:06 -------
Let me start by saying that the comment about a blank line before the Class-Path
entry is wrong. Not the problem and in fact makes the manifest invalid. 

Anyway, I have used the same technique as you previously and it has worked for
me. The relevant bits from my build are

  <target name="warpath">
    <!-- Classpath for War - lib dependencies -->
    <pathconvert dirsep="/" pathsep=" " property="war.classpath">
      <map from="${lib.app.dir}" to="lib"/>
      <path>
        <fileset dir="${lib.app.dir}">
          <include name="*xwork*"/>
          <include name="*webwork*"/>
          <include name="*velocity*"/>
          <include name="*ognl*"/>
          <include name="*oscore*"/>
          <include name="*osuser*"/>
          <include name="*sitemesh*"/>
          <include name="*commons-logging*"/>
          <include name="*util-general*"/>
          <exclude name="*.tld"/>
        </fileset>
      </path>
    </pathconvert>
  </target>

  <target name="war" depends="compile, warpath">
    <war webxml="${appconf.dir}/web.xml" warfile="${war.file}">
      <manifest>
        <attribute name="Class-Path" value="${war.classpath}"/>
      </manifest>
      <fileset dir="${build.dir}" includes="${startpage}"/>

The resulting manifest, which does work, is 

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6beta 
Created-By: 1.4.2-b28 (Sun Microsystems Inc.)
Class-Path: lib/commons-logging.jar lib/ognl-2.5.1.jar lib/oscore-2.2.
 1.jar lib/osuser-1.0-dev-13Jun03.jar lib/sitemesh.jar lib/util-genera
 l-0.1.jar lib/velocity-dep-1.3.1.jar lib/webwork-2.0-dev.jar lib/xwor
 k-1.0-dev.jar

I wrote a small program to check what the JVM's Manifest class thinks of your
manifest

import java.util.jar.Manifest;
import java.io.InputStream;
import java.io.FileInputStream;

public class TestMF {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("Manifest.mf");

        Manifest mf = new Manifest(is);
        System.out.println("Classpath is " +
mf.getMainAttributes().getValue("Class-Path"));
    }
}

and this is the result

Classpath is JCalendar4.jar MDateSelector.jar forms-1.0.2.jar j2ee.jar
jboss-client.jar jboss-common-client.jar jboss-j2ee.jar jbosssx-client.jar
jnp-client.jar log4j.jar

which looks OK. So I wonder if the problem lies elsewhere. Can you tell us how
this jar is being launched, etc and what the actual errors are.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message