Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 86491 invoked from network); 29 Jun 2009 14:39:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jun 2009 14:39:43 -0000 Received: (qmail 39452 invoked by uid 500); 29 Jun 2009 14:39:52 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 39364 invoked by uid 500); 29 Jun 2009 14:39:52 -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 39354 invoked by uid 99); 29 Jun 2009 14:39:52 -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 14:39:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qazwart@gmail.com designates 209.85.221.183 as permitted sender) Received: from [209.85.221.183] (HELO mail-qy0-f183.google.com) (209.85.221.183) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 14:39:44 +0000 Received: by qyk13 with SMTP id 13so422370qyk.14 for ; Mon, 29 Jun 2009 07:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bLfbg/JSux2vt+/CFOk4k3yEiTl3+vAdNfB5cmEK2X8=; b=v7dKkuEa8NxsxFVg2cp3aNQlLQAYV6xOpLGNqy1WK2Gm04OtEsdOoooncjiJflhVII pf/IsElacAn4cgqrE7GoT3HVqaLB48yqmrc1JmrYWt6rHImswZCRB79k7oCQRbxkBI8i FnXm6TWFHU+R3kBZ/5qHrDgEn+VGlJsX0ljcs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=BXI/9LIgyJdWAUb6sgi8tu6Ukbq5At1gD+OXyWMfEs+gazPS4opJsYg1jNqQ//BrHW sbvXayUFewy06pXeFLOqeRuzFgqz0jWcOFRXel0QXXIELqLUwSbfys+Je0puqeV4q5+9 33niGde07AeEcPlKY2tUHWKev72NFglZ3dHbQ= MIME-Version: 1.0 Received: by 10.224.67.129 with SMTP id r1mr5630118qai.246.1246286362813; Mon, 29 Jun 2009 07:39:22 -0700 (PDT) In-Reply-To: <1fb30820906290002xcb2f8a2kcf7869a4fd4784e6@mail.gmail.com> References: <1fb30820906290002xcb2f8a2kcf7869a4fd4784e6@mail.gmail.com> Date: Mon, 29 Jun 2009 10:39:22 -0400 Message-ID: Subject: Re: Manifest.MF - classpath is in wrong format when generated programmatically. From: David Weintraub To: Ant Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Just curious: Why don't you use the task and the task? On Mon, Jun 29, 2009 at 3:02 AM, Garima Bathla wro= te: > 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 ver= y > hard way that if Class-Path in a jar is not set as per the standards it w= ill > 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 =3D "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 =3D new > Manifest.Attribute(Manifest.ATTRIBUTE_CLASSPATH, > formattedManifestClassPath); > > * > *manifest.addConfiguredAttribute(classpathAttribute);* > > Now the problem is that the Class-Path in MANIFEST.MF file is generated a= s > > *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* > * =A0qqq.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). =A0How can I *generate class-path *in the correct > format? How do I set the String? Please note I am generating the classpat= h > programatically ( by extending the task and passing in the properties) > > I have tried inserting \n ( new line character after every jar entery), b= ut > ManifestClasspath is still not correct as Jar task inserts a new line > character after every 71st character. > > formattedManifestClassPath =3D "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. > --=20 David Weintraub qazwart@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org