ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <Richard.Hens...@McKesson.com>
Subject RE: Ant Scrambling the manifest file (was: Using Main-Class and C lass-Path in a manifest file)
Date Wed, 13 Mar 2002 00:47:20 GMT
Conor, 

I've done some more research based on your quotes from the
specification, rereading the specification, and the java bug database.
This was reported to Sun in jdk1.2 and Sun indicated basically the same
thing that you did, it is not a bug. I will modify my manifest file to
conform to the standard by adding Name: entries to my sections and call
it a day. Thanks for your help.

If you care one of the several java bugs reported about this issue is
http://developer.java.sun.com/developer/bugParade/bugs/4333854.html
<http://developer.java.sun.com/developer/bugParade/bugs/4333854.html> 

I don't see any reason to modify the Ant code. 

Thanks for your help, 

Richard 
-----Original Message----- 
From: Conor MacNeill [ mailto:conor@cortexebusiness.com.au
<mailto:conor@cortexebusiness.com.au> ] 
Sent: Tuesday, March 12, 2002 4:41 PM 
To: Ant Users List 
Subject: RE: Ant Scrambling the manifest file (was: Using Main-Class and

Class-Path in a manifest file) 


Richard, 

> From: Hensley, Richard [ mailto:Richard.Hensley@McKesson.com
<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
<http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html>  
> < http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html
<http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html> > 
> 

Thanks 
Conor 


-- 
To unsubscribe, e-mail:   <
mailto:ant-user-unsubscribe@jakarta.apache.org
<mailto:ant-user-unsubscribe@jakarta.apache.org> > 
For additional commands, e-mail: <
mailto:ant-user-help@jakarta.apache.org
<mailto:ant-user-help@jakarta.apache.org> > 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message