Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 20604 invoked from network); 29 Jun 2009 07:02:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jun 2009 07:02:26 -0000 Received: (qmail 67588 invoked by uid 500); 29 Jun 2009 07:02:36 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 67495 invoked by uid 500); 29 Jun 2009 07:02:35 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 67485 invoked by uid 99); 29 Jun 2009 07:02:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 07:02:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of garima.bathla@gmail.com designates 209.85.222.182 as permitted sender) Received: from [209.85.222.182] (HELO mail-pz0-f182.google.com) (209.85.222.182) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 07:02:27 +0000 Received: by pzk12 with SMTP id 12so2233300pzk.14 for ; Mon, 29 Jun 2009 00:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=0dMidQwpDp717ZBj+G3v8I2SADrYL4MF5uLc2vcSZfY=; b=h0zSiHeKm6LZ2Bz9WHw4J/udRG4AO9XIXRBjOf3OMMFWIsDwKtvECxFZ7f2QcwV1/6 dfYhr4GxPdwIqrHAiKr3+/uVSYRHM0J+bTRMNrsaWVOEILQv2qURkdcT6dIBdkzU7MlM U1NytAD8wfhg3hDVUHHkFwANknwAp0PcGJV3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mI0x14cSnturW5UexE+UnYas0Vdh7iDkyAAK6jJfU0Pr1EK9/MZrXBIiJ77FUdcDDk C5ZZV/X4cpXyZ3Qn7+k0DaHzIpahJPpB7BukQOV6CfYMI5TzjZKmnuubf7LDbxR24wGc VztYUhyFcq1Z8EAAXJhevpqWdyb4nWaCFaqfM= MIME-Version: 1.0 Received: by 10.114.67.17 with SMTP id p17mr10955188waa.163.1246258926922; Mon, 29 Jun 2009 00:02:06 -0700 (PDT) Date: Mon, 29 Jun 2009 00:02:06 -0700 Message-ID: <1fb30820906290002xcb2f8a2kcf7869a4fd4784e6@mail.gmail.com> Subject: Manifest.MF - classpath is in wrong format when generated programmatically. From: Garima Bathla To: user@ant.apache.org Content-Type: multipart/alternative; boundary=00163646c77aa32b92046d77443f X-Virus-Checked: Checked by ClamAV on apache.org --00163646c77aa32b92046d77443f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Dear Fellow memebers, I really need help , I have been stuck with same problem for few days now. Problem: As we all know, manifest file syntax is very sensitive ( sensitive to spaces, # of characters in a line, \n character). And I have learn it very hard way that if Class-Path in a jar is not set as per the standards it will be silently ignored. I am in the process of generating MANIFEST.MF file programmatically by Extending Jar Task; I am almost there, but the class-path that Jar task prints in the Manifest file isn't formatted correctly. *Code snippet:* *String formattedManifestClassPath = "aaa.jar bbb.jar ccc.jar ddd.jar eee.jar fff.jar ggg.jar hhh.jar iii.jar jjj.jar kkk.jar lll.jar mmm.jar nnn.jar ooo.jar ppp.jar qqq.jar rrr.jar sss.jar ttt.jar uuu.jar vvv.jar www.jar xxx.jar yyy.jar zzz.jar";* ** *Manifest.Attribute classpathAttribute = new Manifest.Attribute(Manifest.ATTRIBUTE_CLASSPATH, formattedManifestClassPath); * *manifest.addConfiguredAttribute(classpathAttribute);* Now the problem is that the Class-Path in MANIFEST.MF file is generated as *Class-Path: aaa.jar bbb.jar ccc.jar ddd.jar eee.jar fff.jar ggg.jar hh* * h.jar iii.jar jjj.jar kkk.jar lll.jar mmm.jar nnn.jar ooo.jar ppp.jar* * qqq.jar rrr.jar sss.jar ttt.jar uuu.jar vvv.jar www.jar xxx.jar yyy.* * jar zzz.jar* * * So if I run "java -jar generated.jar" Class-Path is being ignored, because it is not well formed (jar name hhh.jar is split over 2 lines). How can I *generate class-path *in the correct format? How do I set the String? Please note I am generating the classpath programatically ( by extending the task and passing in the properties) I have tried inserting \n ( new line character after every jar entery), but ManifestClasspath is still not correct as Jar task inserts a new line character after every 71st character. formattedManifestClassPath = "aaa.jar \n bbb.jar \n ccc.jar \n ddd.jar \n eee.jar \n fff.jar \n ggg.jar \n hhh.jar \n iii.jar \n jjj.jar \n kkk.jar \n lll.jar \n mmm.jar \n nnn.jar \n ooo.jar \n ppp.jar \n qqq.jar \n rrr.jar \n sss.jar \n ttt.jar \n uuu.jar \n vvv.jar \n www.jar \n xxx.jar \n yyy.jar \n zzz.jar"; Any pointers if you know will be very helpful. Is it is a bug? Regards, Garima. --00163646c77aa32b92046d77443f--