0

On my Mac, tar defaults to BSD tar.

$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3

There is a GNU tar that I can invoke with gnutar.

$ gnutar --version
tar (GNU tar) 1.17
Copyright (C) 2007 Free Software Foundation, Inc.
...

With Ant Tar task, how do I configure it to use the GNU tar?

moey
  • 10,587
  • 25
  • 68
  • 112

2 Answers2

1

As @Raghuram wrote, modern versions of Ant do not use an external tar program; instead, they have their own pure-Java implementation. However, you can produce behavior similar to GNU tar by using the longfile="gnu" attribute. From the manual:

If the loss of path or file information is not acceptable, and it rarely is, longfile may be set to the value gnu. The tar task will then produce a GNU tar file which can have arbitrary length paths. Note however, that the resulting archive will only be able to be untarred with GNU tar.

Matt Solnit
  • 32,152
  • 8
  • 53
  • 57
0

ant tar task does not use the system tar command. Thus the question of configuring an alternate tar implementation does not arise.

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Did you mean that Ant has its own implementation of _tar_? I was interested in knowing whether the tar file created by Ant can properly be _untar_-ed using different implementation of `tar`. – moey Mar 28 '12 at 07:25