Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 24178 invoked from network); 13 Mar 2002 00:41:26 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Mar 2002 00:41:26 -0000 Received: (qmail 29592 invoked by uid 97); 13 Mar 2002 00:41:18 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 29547 invoked by uid 97); 13 Mar 2002 00:41:18 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 29520 invoked from network); 13 Mar 2002 00:41:17 -0000 From: "Conor MacNeill" To: "Ant Users List" Subject: RE: Ant Scrambling the manifest file (was: Using Main-Class and Class-Path in a manifest file) Date: Wed, 13 Mar 2002 11:40:59 +1100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal In-Reply-To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Richard, > From: Hensley, Richard [mailto:Richard.Hensley@McKesson.com] > > The first pain it caused me was that the .jar file would not pass > through the QA department because the contents were not was expected. I > didn't go beyond that because I can't deliver software without QA > approval. It seemed easier to use ant13 than fight the battle. I'll look into retaining the order of elements in the manifest although it is not required by the spec. "Manifest-Version and Signature-Version must be first, and in exactly that case (so that they can be recognized easily as magic strings). Other than that, the order of attributes within a main section is not significant. " > > The second problem I ran into was that sections seperated by blank lines > were mixed up, and information from my sections are placed in the main > attribute section. I reviewed the JAR Manifest specification, and it > indicates that only legitimate main attributes belong in the main > section. A section requires a Name attribute. Check out this from the spec. "individual-section: Name : value newline *perentry-attribute " Since they don't have names your sections are treated as parts of the main section according to this rule from the spec "If there are multiple individual sections for the same file entry, the attributes in these sections are merged. If a certain attribute have different values in different sections, the last one is recognized. " > > The manifest I create contains the following: > -----start----- > Manifest-Version: 1.0 > > Specification-Title: Horizon Lab (classes) > Specification-Vendor: McKesson > Specification-Version: 8.0.0 > > Implementation-Vendor: McKesson (Horizon Lab) > Implementation-Version: 8.0.0-hlab-20020312@1604-00060 > Implementation-Title: Horizon Lab > > Build-Date: 20020312@1604 > Build-Number: 00060 > Build-Environment: C:\pwl\projects\lab\build rhensle > -----end----- > > The manifest placed in the jar created by ant 1.4.1 contains: > ----start---- > Manifest-Version: 1.0 > Implementation-Version: 8.0.0-hlab-20020312@1604-00060 > Specification-Title: Horizon Lab (classes) > Specification-Version: 8.0.0 > Implementation-Title: Horizon Lab > Build-Date: 20020312@1604 > Created-By: Ant 1.4 > Build-Number: 00060 > Implementation-Vendor: McKesson (Horizon Lab) > Build-Environment: C:\pwl\projects\lab\build rhensle > Specification-Vendor: McKesson > ----end---- > That is correct according to the spec. 1.3 just puts the manifest into the file and does not validate it in any way. It could be totally incorrect. > The manifest placed in the jar created by jar cvfm test.jar > classes-manifest classes/* > ----start--- > Manifest-Version: 1.0 > Implementation-Version: 8.0.0-hlab-20020312@1604-00060 > Specification-Title: Horizon Lab (classes) > Specification-Version: 8.0.0 > Implementation-Title: Horizon Lab > Build-Date: 20020312@1604 > Created-By: 1.3.1_01 (Sun Microsystems Inc.) > Build-Number: 00060 > Implementation-Vendor: McKesson (Horizon Lab) > Build-Environment: C:\pwl\projects\lab\build rhensle > Specification-Vendor: McKesson > ----end---- > > Note the Implementation-Version is in the main section, and the > Created-By is not in the main section. These both seem to violate the > specification. No. You need "Name" to get a separate section. > > It is interesting to note that the jar command for jdk1.3.1_01 does the > same exact action as ant 1.4.1. Now I'm very confused. I'm not sure what > the right thing to do is.... Also, the manfest created by ant 1.3 is > exactly the same as the file, except I don't think it is valid because > it lacks a Created-By: Yes, Under 1.3 you'll need to add Created-By in yourself. > > The URL for the specification is > http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html > > Thanks Conor -- To unsubscribe, e-mail: For additional commands, e-mail: