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 2001/12/03 01:05:32 UTC

DO NOT REPLY [Bug 5230] New: - Problem using fileset in signjar task

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>