Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 27028 invoked from network); 29 Jun 2009 16:12:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jun 2009 16:12:25 -0000 Received: (qmail 75332 invoked by uid 500); 29 Jun 2009 16:12:35 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 75258 invoked by uid 500); 29 Jun 2009 16:12: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 75248 invoked by uid 99); 29 Jun 2009 16:12:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 16:12: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 (nike.apache.org: domain of garima.bathla@gmail.com designates 209.85.216.192 as permitted sender) Received: from [209.85.216.192] (HELO mail-px0-f192.google.com) (209.85.216.192) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jun 2009 16:12:25 +0000 Received: by pxi30 with SMTP id 30so421475pxi.14 for ; Mon, 29 Jun 2009 09:12:04 -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; bh=vaPx1r3Bmll/7p7QaFwMWAhVhEO8a1av9fmbsK3qfhY=; b=F9PXpfP6is7P3SAxw/PLoccKPMPouPZj0o7WyoKnSyz8LHzV4xmmGyUONFaLXyFEBs z0hs8AEXktOvgLgyV7Tx1F5yAnX4E5U80xZqQ2fnzYpdEHtVyqU2tGldOBp4SuztVaex 2EFDwcLL+il6rv3AsKiWARtWFbWXFF9bkpCLo= 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; b=gPehEE2Ga9eMp8AWt7TXMNT5j00LC/+2+Cdg0UYfsUg08/21SdWHWKshe+vQHR6y1c oAfkbmQSrE8Rbn1gN4mlk8hYkrsGrZzK82OlvIhuRdM5NgACFI4tZrINgBBclqjfemIa AOH36N2kaHmAqU+optUvDzXd2H3mwQS3lH1k4= MIME-Version: 1.0 Received: by 10.115.91.15 with SMTP id t15mr11554338wal.70.1246291924103; Mon, 29 Jun 2009 09:12:04 -0700 (PDT) In-Reply-To: References: <1fb30820906290002xcb2f8a2kcf7869a4fd4784e6@mail.gmail.com> Date: Mon, 29 Jun 2009 09:12:04 -0700 Message-ID: <1fb30820906290912l563ba206s605b69a2ecabf8ec@mail.gmail.com> Subject: Re: Manifest.MF - classpath is in wrong format when generated programmatically. From: Garima Bathla To: Ant Users List Content-Type: multipart/alternative; boundary=00163646d8fc6c5ca9046d7ef3ee X-Virus-Checked: Checked by ClamAV on apache.org --00163646d8fc6c5ca9046d7ef3ee Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit David : Thanks, I have tried setting the class-path via manifestclasspath task as well within a build.xml ant script and it is the same result, with long class-path's the jar names are split over differnt lines with \n and space character. On Mon, Jun 29, 2009 at 7:39 AM, David Weintraub wrote: > Just curious: Why don't you use the task and the > task? > > On Mon, Jun 29, 2009 at 3:02 AM, Garima Bathla > wrote: > > 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. > > > > > > -- > David Weintraub > qazwart@gmail.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --00163646d8fc6c5ca9046d7ef3ee--