You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nathan Coast <na...@levelseas.com> on 2001/12/06 18:20:28 UTC

manifest class path

Hi, 

the jar task seems to be messing up the classpath entry in my manifest file
(splits it onto two lines as below).

Class-Path: lib/fop.zip lib/commons-collections.zip lib/commons-digest
 er.zip lib/commons-beanutils.zip lib/core.zip


anyone else seeing this problem? is there a workaround?

Thanks Nathan


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper at LevelSeas for the presence of computer viruses.

**********************************************************************

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: manifest class path

Posted by "J. Matthew Pryor" <ma...@versata.com>.
> Actually I tried an experiment to take and Ant path, convert it 
> into a property and then use that in the "classpath.string" 
> setting above but it did not work since it gives absoluet path 
> elements where you really want relative elements for this 
> application. You may be able to use <pathconvert> but I didn't go 
> that far.
> 
> Conor
> 

Thanks for all the additional info, I will give it a try

Matthew


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: manifest class path

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Matthew,

> > 
> >      <jar jarfile="test.jar" basedir="." manifest="manifest.mf">
> >        <include name="src/**"/>
> >        <manifest>
> >          <attribute name="Class-Path" value="${classpath.string}"/>
> >        </manifest>
> >      </jar>
> > 
> > 
> 
> Great so this will merge the in-line manifest with the specified 
> manifest (manifest="manifest.mf") ?

Yes

> 
> I can see it is contentious, but what happens when there are 
> overlapping Class-Path entries ?

Well one Sun spec says you can't have duplicate entries in the same section of a manifest while another recommends multiple Class-Path entries. We have made a change in CVS which treats Class-Path as a special case. Ant 1.4.1 will complain if there are multiple entries, I believe.

> 
> The manifest spec say you can have multiple Class-Path entries as 
> I read it, but from viewing the 1.4.1 code it looks like the 
> section merge code will replace one with the other

That wasn't how I originally read the spec:
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html

Check the Notes section. In any case we do now allow it.

> 
> Thanks very much for clearing this up (sorry about the feature grab ;-)
> 

Actually I tried an experiment to take and Ant path, convert it into a property and then use that in the "classpath.string" setting above but it did not work since it gives absoluet path elements where you really want relative elements for this application. You may be able to use <pathconvert> but I didn't go that far.

Conor


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: manifest class path

Posted by "J. Matthew Pryor" <ma...@versata.com>.
Connor

Thanks for the response

> 2. The second issue is support for automatically writing classpath 
> entries in the jar file. There is no  direct support for this operation 
> but there is something you can do using inline manifests. Something like 
> this
> 
>      <jar jarfile="test.jar" basedir="." manifest="manifest.mf">
>        <include name="src/**"/>
>        <manifest>
>          <attribute name="Class-Path" value="${classpath.string}"/>
>        </manifest>
>      </jar>
> 
> 

Great so this will merge the in-line manifest with the specified manifest (manifest="manifest.mf") ?

I can see it is contentious, but what happens when there are overlapping Class-Path entries ?

The manifest spec say you can have multiple Class-Path entries as I read it, but from viewing the 1.4.1 code it looks like the section merge code will replace one with the other

Thanks very much for clearing this up (sorry about the feature grab ;-)

Cheers,
Matthew


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: manifest class path

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
J. Matthew Pryor wrote:

> I am a bit confused by exactly what support for Class-Path there is in the current version of Ant
> 
> Is it that the Jar task should just leave Class-Path entries alone in a manifest I supply ?
> 
> Or is there some expanded support whereby I can specify the set of dependent Jars and the Jar task will add/update the manifest to make the Class-Path entry correct ?
> 
> Thanks for any clarification. I have searched ant-user and ant-dev without too much success
> 
> Cheers,
> Matthew
> 



Matthew,

There are two distinct issues here.

1. The Jar task processes manifests according to the Jar file spec. This 
requires that no lines are longer than 72 bytes. Accordingly the jar 
task will break up longer lines and use a continuation line ( a line 
beginning with a space). Other than this processing, the jar task does 
not change the manifest file content.

2. The second issue is support for automatically writing classpath 
entries in the jar file. There is no  direct support for this operation 
but there is something you can do using inline manifests. Something like 
this

     <jar jarfile="test.jar" basedir="." manifest="manifest.mf">
       <include name="src/**"/>
       <manifest>
         <attribute name="Class-Path" value="${classpath.string}"/>
       </manifest>
     </jar>

Conor




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: manifest class path

Posted by "J. Matthew Pryor" <ma...@versata.com>.
I am a bit confused by exactly what support for Class-Path there is in the current version of Ant

Is it that the Jar task should just leave Class-Path entries alone in a manifest I supply ?

Or is there some expanded support whereby I can specify the set of dependent Jars and the Jar task will add/update the manifest to make the Class-Path entry correct ?

Thanks for any clarification. I have searched ant-user and ant-dev without too much success

Cheers,
Matthew


> -----Original Message-----
> From: Peter Donald [mailto:peter@apache.org]
> Sent: Friday, December 07, 2001 9:25 AM
> To: Ant Users List
> Subject: Re: manifest class path
> 
> 
> On Fri, 7 Dec 2001 04:20, Nathan Coast wrote:
> > Hi,
> >
> > the jar task seems to be messing up the classpath entry in my 
> manifest file
> > (splits it onto two lines as below).
> >
> > Class-Path: lib/fop.zip lib/commons-collections.zip lib/commons-digest
> >  er.zip lib/commons-beanutils.zip lib/core.zip
> >
> >
> > anyone else seeing this problem? 
> 
> It's not a problem - it's how the spec saids it should behave.
> 
> -- 
> Cheers,
> 
> Pete
> 
> ---------------------------------------------------
> "Marriage, Friends, Religon -- these are the demons 
> you must slay in order to suceed in business.." 
>                  -- Mr. Burns, The Simpsons 
> ---------------------------------------------------
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: manifest class path

Posted by Peter Donald <pe...@apache.org>.
On Fri, 7 Dec 2001 04:20, Nathan Coast wrote:
> Hi,
>
> the jar task seems to be messing up the classpath entry in my manifest file
> (splits it onto two lines as below).
>
> Class-Path: lib/fop.zip lib/commons-collections.zip lib/commons-digest
>  er.zip lib/commons-beanutils.zip lib/core.zip
>
>
> anyone else seeing this problem? 

It's not a problem - it's how the spec saids it should behave.

-- 
Cheers,

Pete

---------------------------------------------------
"Marriage, Friends, Religon -- these are the demons 
you must slay in order to suceed in business.." 
                 -- Mr. Burns, The Simpsons 
---------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>