1.15. Element `zip`
Prev | 1. Reference | Next

### 1.15. Element `zip`

    <zip
      archive = Path
    >
      Content: [ add ]+
    </zip>

    <add
      files = Glob pattern
      baseDir = Path : .
      store = boolean : false
    />

Creates a Zip archive located at `archive` containing the files specified by the `add` child elements.

When specified with value `true`, the `store` attribute of the `add` child element allows to add entries to a Zip archive without compressing them.

See also jar.

Example: Let's suppose current working directory contains:

    /tmp$ ls -R
    doc.xml
    doc.xml~
    doc.xml.SAVE

    ./attachments:
    data1.bin
    data1.zip
    data2.bin
    data2.zip

    ./resources:
    logo.png
    chart1.jpeg

    <zip archive="all.zip">
      <add files="doc.xml" />
      <add files="resources/*" store="true" />
      <add files="misc/*" />
      <add files="*.bin" baseDir="attachments" />
    </zip>

The above `zip` element creates in current working directory, an archive called `all.zip`, containing:

    /tmp$ unzip -v all.zip
    doc.xml
    resources/
    resources/logo.png
    resources/chart1.jpeg
    data1.bin
    data2.bin

Note that non-existent directory `misc/` will not cause the `zip` element to stop its processing or to report a warning.

Prev | Up | Next
1.14. Element `copy` | Home | 1.16. Element `jar`