ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs VerifyJar.java
Date Wed, 06 Apr 2005 15:49:30 GMT
mbenson     2005/04/06 08:49:29

  Modified:    src/main/org/apache/tools/ant/taskdefs VerifyJar.java
  Log:
  Work around jdk 1.4.2(no _version) jarsigner bug.
  
  Revision  Changes    Path
  1.3       +20 -4     ant/src/main/org/apache/tools/ant/taskdefs/VerifyJar.java
  
  Index: VerifyJar.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/VerifyJar.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VerifyJar.java	24 Mar 2005 17:17:09 -0000	1.2
  +++ VerifyJar.java	6 Apr 2005 15:49:29 -0000	1.3
  @@ -17,6 +17,7 @@
   
   package org.apache.tools.ant.taskdefs;
   
  +import org.apache.tools.ant.Project;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.filters.ChainableReader;
  @@ -134,10 +135,25 @@
           log("Verifying JAR: " +
                   jar.getAbsolutePath());
           outputCache.clear();
  -        cmd.execute();
  -        String results=outputCache.toString();
  -        if(results.indexOf(VERIFIED_TEXT)<0) {
  -            throw new BuildException(ERROR_NO_VERIFY+jar);
  +        BuildException ex = null;
  +        try {
  +            cmd.execute();
  +        } catch (BuildException e) {
  +            ex = e;
  +        }
  +        String results = outputCache.toString();
  +        //deal with jdk1.4.2 bug:
  +        if (ex != null) {
  +            if (results.indexOf("zip file closed") >= 0) {
  +                log("You are running " + JARSIGNER_COMMAND + " against a JVM with"
  +                    + " a known bug that manifests as an IllegalStateException.",
  +                    Project.MSG_WARN);
  +            } else {
  +                throw ex;
  +            }
  +        }
  +        if (results.indexOf(VERIFIED_TEXT) < 0) {
  +            throw new BuildException(ERROR_NO_VERIFY + jar);
           }
       }
   
  
  
  

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


Mime
View raw message