You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/10/19 00:15:04 UTC

[Bug 54026] New: Zip task on that excludes certain files by way of the mapper results in a NullPointerException

https://issues.apache.org/bugzilla/show_bug.cgi?id=54026

          Priority: P2
            Bug ID: 54026
          Assignee: notifications@ant.apache.org
           Summary: Zip task on <mappedresources> that excludes certain
                    files by way of the mapper results in a
                    NullPointerException
          Severity: normal
    Classification: Unclassified
          Reporter: dtrebbien@gmail.com
          Hardware: All
            Status: NEW
           Version: 1.8.2
         Component: Core tasks
           Product: Ant

Steps to reproduce:

1. Create a folder named `test' with the following:

   test/
   test/test1
   test/subdir/
   test/subdir/test2

   (`test1' and `test2' are regular files.)

2. Create a `build.xml' with the following:

<project name="testcase" default="go" basedir=".">
    <target name="go">
        <zip destfile="destzip.zip">
            <mappedresources>
                <fileset dir="test"/>
                <globmapper from="subdir/*" to="subdir.orig/*"/>
            </mappedresources>
        </zip>
    </target>
</project>

3. Run `ant'.



Actual result:
NullPointerException thrown in org.apache.tools.ant.taskdefs.Zip.addResources.



Expected result:
`ant' finishes without error and there is a new ZIP file called `destzip.zip'
in the current directory. `zip -sf destzip.zip' should print:

Archive contains:
  subdir.orig/
  subdir.orig/test2
Total 2 entries



Tested in:
Ant 1.8.2 and 1.8.4 on Mac OS 10.7.5.



Known work-around:
Add an `excludes' attribute to the <fileset> to exclude all files not matched
by the "from" glob. For the given example, `excludes="test1"'.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54026] Zip task on that excludes certain files by way of the mapper results in a NullPointerException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54026

Daniel Trebbien <dt...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dtrebbien@gmail.com
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54026] Zip task on that excludes certain files by way of the mapper results in a NullPointerException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54026

--- Comment #1 from Daniel Trebbien <dt...@gmail.com> ---
Created attachment 29496
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29496&action=edit
Patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54026] Zip task on that excludes certain files by way of the mapper results in a NullPointerException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54026

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |1.9.0

--- Comment #2 from Antoine Levy-Lambert <an...@apache.org> ---
Patch submitted, thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.