ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5230] New: - Problem using fileset in signjar task
Date Mon, 03 Dec 2001 00:05:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5230>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5230

Problem using fileset in signjar task

           Summary: Problem using fileset in signjar task
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: mleclerc@accelight.com


The SignJar task doesn't take into account the base directory specified in a 
fileset. Here is an example: 

    <signjar keystore="myKeystore" alias="myself" storepass="password">
        <fileset dir="myDir" includes="*.jar"/>
    </signjar>

The fileset will find all the files ending with .jar under myDir but the 
relative path (from myDir) is passed to the doOneJar() method rather than the 
full path i.e. myDir/<relative path to jar file>. As a result signjar is trying 
to sign a jar file from the current directory using the relative path to the 
jar file found: 

    > signjar <relative path to jar file>

and this lead to the following error:

    > signjar: cannot sign jar file: <relative path to jar file>

To fix this problem, lines 178-180 in SignJar.java:

    for(int j=0; j<jarFiles.length; j++) {
        doOneJar(jarFiles[j], null);
    }

Must be changed to:

    File fromDir = fs.getDir(project);
    for(int j=0; j<jarFiles.length; j++) {   
        File jarFile = new File(fromDir, jarFiles[j]);
        doOneJar(jarFile.toString(), null);
    }

Hope this helps,

Martin.

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


Mime
View raw message