You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/09/29 17:19:02 UTC

DO NOT REPLY [Bug 36865] New: - jar task : building a Class-Path

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36865>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36865

           Summary: jar task : building a Class-Path
           Product: Ant
           Version: 1.6.5
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: andy.seaborne@hp.com


Trying to set a long Class-Path fails in v1.6.5

ant -version
==>
Apache Ant version 1.6.5 compiled on June 2 2005

Case 1/ Inline value (see sample below)

This is because class paths in jar manifests are separated by spaces 
and spaces are also the continuation character in jar manifests.  The jar
task breaks the long lines so that space may be on the front.

Case 2/ Specify an existing manifest file

The manifest file has trailing spaces in the Class-Path.

The task seems to parse the manifest but then wrap the Class-Path value up
without regard to the internal spaces to the value.


There is a trick to get spaces into a long Class-Path which is to have trailing
spaces in the manifest.  This works when running the Java SDK (1.5.0) jar
command directly and the same manifest in 2/ used directly works.

Manifest-Version: 1.0
Main-Class: arq.query
Class-Path: arq.jar jena.jar 
            xercesImpl.jar xml-apis.jar 
            stax-1.1.1-dev.jar stax-api-1.0.jar 
            commons-logging.jar 
            concurrent.jar icu4j.jar 
            jakarta-oro-2.0.5.jar junit.jar

(each intermediate line in Class-Path has a trailing space)

Samples:

     <jar destfile="${appjarfile}">
	<fileset dir="${lib.dir}" includes="*.jar"/>
	<manifest>
	  <attribute name="Main-Class" value="arq.query"/>
	  <attribute name="Class-Path" value="${lib.jars}"/>
	</manifest>
      </jar>

lib.jars is set to a string of jars names with spaces 

      <pathconvert pathsep="   " property="lib.jars">
	<path>
	  <fileset dir="${lib.dir}" includes="*.jar"/>
	</path>
	<mapper type="flatten"/>
      </pathconvert>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org